Hello All,
Could you please explain why do I have error here?
---
- 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
fail: msg="The script file wasn't copied to server {{ansible_hostname}}
{{ansible_default_ipv4.address}}."
when: st.stat.exists != True
The error is
[root@server-03 ~]# ansible-playbook /etc/ansible/sample.yml --syntax-check
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/etc/ansible/sample.yml': line 9, column
15, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
stat: path=/root/sample.pl
register: st
^ here
I tried
- stat: ...
and
- register: ...
but this didn't help.
Thank you very much in advance.
--
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/63b769b4-094d-4faf-8835-7e86d8041e4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.