Hy,
I want start one service with next command in ansible :
- name: Start service httpd, if not started
service:
name: httpd
state: started
This task not work even with line command become: yes ! on the other hand the next command works :
The service module uses init. Since I see systemctl works for you, you are not using init to manage your services but systemd. There is another ansible module for that:
https://docs.ansible.com/ansible/latest/modules/systemd_module.html
Are you using Ansible AWX? Can you provide the error message out output from this task?
matburt
(Matthew Jones)
4
If this is an ansible issue you are better off seeking answers from the Ansible mailing list or IRC channel.