Thank you, it works.
I realize the checks look redundant, it was just attempt to study how it
can be used.
On Thursday, September 10, 2015 at 5:02:48 PM UTC-4, Brian Coca wrote:
>
> several errors, each task needs a -, register and when are task
> directives and not part of the modules so need to be at the same
> level:
>
>
> - hosts: all
> tasks:
>
> - name: copy the script
> copy: src=/etc/ansible/sample.pl dest=/root/sample.pl mode=0700
>
> - stat: path=/root/sample.pl
> register: st
> name: checking that file is there, which is redundant if copy
> succeeded
>
> - fail: msg="The script file wasn't copied to server
> {{ansible_hostname}} {{ansible_default_ipv4.address}}."
> when: st.stat.exists != True
> name: again redundant as copy will show an error already for that
> host if the script fails to be copied
>
>
>
> --
> Brian Coca
>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/bca49403-0dee-407f-825e-1d226ac66a77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.