Hi,
I'm new to ansible, so looking for some pointers or samples.
I have a directory of monit conf files on my ansible server that I want to
send to remote hosts using synchronize module.
Once I synchronize the conf directory, I want to reload monit. If monit
fails to start due to syntax errors in the conf files, then I want to
restore the original conf files that are working before from backup.
I couldn't figure out how to do this last step. any pointers?
This is what I have so far
---
- hosts: remote_hosts
gather_facts: false
tasks:
- name: rsync monit configruation files
synchronize: src=/home/foo/conf/ dest=/opt/monit/conf/ backup=yes
notify: reload monit
handlers:
- name: reload monit
service: name=monit state=reloaded
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/4250f676-6e82-41f2-9613-df8dc9e4fe71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.