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/CAJ5XC8kkxGiASy66UQ2q8JgxEocDuokK_mky3DG5W51KDEG4Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to