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
msg:"Path exists and is a directory"
msg: "Path exists and is a directory"
--
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+unsubscribe@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/91e04a50-7814-4155-806c-09e2edd1435c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/91e04a50-7814-4155-806c-09e2edd1435c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@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/91aff7ffccb59454ee60aabff2fcc64a%40olstad.com.