change:
msg:"Path exists and is a directory"

to:
msg: "Path exists and is a directory"

Missing space...

On Thursday, December 7, 2017 at 9:56:34 AM UTC-5, Bhautik K wrote:
>
> 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/91e04a50-7814-4155-806c-09e2edd1435c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to