Hi all,
I've searched the group and the ansible documentation, but haven't been able to find a clear answer.
I want to conditionally upload a monit config file in a nginx playbook, but only when the monnit conf directory is present.
tasks:
- name: "add monit nginx config"
copy: src=nginx.monit dest=/etc/monit/conf.d owner=root group=root mode=0700
when: ???
The when condition should return True if the directory /etc/monit/conf.d/ exists.
How can I achieve this? Is the an expression I can use, or should I set a "monit_installed" fact in the monit role, or use facter?
Also, is there a difference between only_if and when?
Cheers and one zillion gallactic kudos for developing Ansible!
Sebastiaan