I have to check whether a file exists in /etc/. If the file exists then I have to skip the task. Here is the code I am using:
/etc/
- name: checking th
vars: mypath: "/etc/file.txt" tasks: - name: checking the file exists command: touch file.txt when: mypath is not exists