Looking for solution. I have write below yml for *if directory is exists or not* but getting below error. Could you please correct me where I did mistake ?
- hosts: compute tasks: - name: Ansible check directory exists. stat: path=/etc/yum.repos.d register: p - debug: msg:"Path exists and is a directory" when: p.stat.isdir is defined and p.stat.isdir ----------------------------- ERROR! Syntax Error while loading YAML. The error appears to have been in '/etc/ansible/postchecklist.yml': line 7, column 4, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: register: p - debug: ^ here -- Thanks & Regards, Bhautik Karkar 9920343224 -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CABJVjawCGPkGRhdgrMJwcGKJep2vCx55xkp68Okx9qmAB53xWw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.