Devo verificare se esiste un file in /etc/
. Se il file esiste, allora devo saltare l'attività. Ecco il codice che sto usando:Come controllare un file esiste in ansible?
- name: checking the file exists
command: touch file.txt
when: $(! -s /etc/file.txt)
Se il file.txt
esiste poi devo saltare il compito.
'state: file' non crea file. Vedi http://docs.ansible.com/ansible/file_module.html –