ansible / ansible-examples

A few starter examples of ansible playbooks, to show features and how they work together. See http://galaxy.ansible.com for example roles from the Ansible community for deploying many popular applications.
11.65k stars 7.69k forks source link

"Could not find the requested service \"'tomcat'\" #163

Open JinPhil opened 8 years ago

JinPhil commented 8 years ago

Hi, I ran the script here on a AWS linux instance to setup and run a simple tomcat instance and I ran into 2 issues:

  1. I had to change the remote_user to a ec2-user in the site.yml --> any way around this ? What is the AWS best practice around this ?
  2. When I ran the script , it stopped at the 'Start Tomcat' command.

Would appreciate any help!

Thanks JinPhil

takasuka commented 7 years ago

I have similar issue. Temporary, I run "systemctl daemon-reload".

noydhiet commented 7 years ago

I have similar issue, when simply running start tomcat playbook

anyone solving this issue? appreciate it

ramanjk commented 5 years ago

@noydhiet : follow below solution

apiraino commented 4 years ago

Perhaps not related, but I had this error because I was running the systemd command under the wrong user (by default is root) and I have services running with less privileges.

As an example, I modified my Ansible commands to something like this:

name: Start Tomcat
become: yes
become_user: <username>
systemd:
  - name: tomcat
  - state: started
  - enabled: yes
  - scope: user

I'm running Ansible v2.9.4

hth