Hi Jordan,
What I have per your advice is :

playbook:
------------------------------

- name: Copies file to Windows
  win_copy:
    src: /ansible/ansible.cfg
    dest: C:\Users\YRunner\Desktop\test1

Then I run it and get:
-------------------------------

root@Raspi_Ctrl:/ansible# ansible-playbook  ./playbook/test1.yml -i
/ansible/hosts

ERROR! Syntax Error while loading YAML.



The error appears to have been in '/ansible/playbook/test1.yml': line 3,
column 15, but may

be elsewhere in the file depending on the exact syntax problem.


The offending line appears to be:


  - name: Copies file to Windows

      win_copy:

              ^ here




On Thu, Oct 26, 2017 at 12:57 PM, Jordan Borean <[email protected]> wrote:

> YAML does not handle \ very well as it is an escaping character in most
> situations. When defining tasks I would highly recommend using the YAML for
> instead of the older key=arg form as it makes your code more readable and
> you don't have to escape \. Your task would now look like this
>
> - name: Copies file to Windows
>   win_copy:
>     src: /ansible/ansible.cfg
>     dest: C:\Users\YRunner\Desktop\test1
>
> When using the YAML form, you don't need to escape \ unless you have
> double quoted the value. I found you don't need to quote a value unless you
> want to convert it to a string or it contains a :.
>
> This has more info on this particular topic http://docs.ansible.com/
> ansible/devel/windows_usage.html#path-formatting-for-windows.
>
> Thanks
>
> Jordan
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/XEh1Fg3D9wE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d197dc22-775c-4c1d-9695-cf02b70129f1%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/d197dc22-775c-4c1d-9695-cf02b70129f1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thank you,
Larry Pescatore
Lab Engineer, ERG Inc. @ Google

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

Reply via email to