Thank you.
It worked once:

root@Raspi_Ctrl:/ansible/playbook# nano test.yml

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


PLAY [nuc]
*********************************************************************


TASK [Gathering Facts]
*********************************************************

ok: [100.xxx]

ok: [100.xxx]


TASK [Copies file to Windows]
**************************************************

changed: [100.xxx]

changed: [100.xxx]


PLAY RECAP
*********************************************************************

100.xxx           : ok=2    changed=1    unreachable=0    failed=0

100.xxx           : ok=2    changed=1    unreachable=0    failed=0


But the a second try with another file:


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


PLAY [nuc]
*********************************************************************


TASK [Gathering Facts]
*********************************************************

ok: [100.xxx]

ok: [100.xxx]


TASK [Copies file to Windows]
**************************************************

fatal: [100.xxx]: FAILED! => {"changed": false, "checksum":
"8d13b59b96713e8ff23461fba04ca45bf53b1db7", "dest":
"C:\\Users\\YRunner\\Desktop\test1", "module_stderr": "Exception calling
\"Run\" with \"1\" argument(s): \"Exception calling \"Invoke\" with \"0\"
argument(s): \"The running command \r\nstopped because the preference
variable \"ErrorActionPreference\" or common parameter is set to Stop:
Illegal characters \r\nin path.\"\"\r\nAt line:65 char:5\r\n+     $output =
$entrypoint.Run($payload)\r\n+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n
  + CategoryInfo          : NotSpecified: (:) [],
ParentContainsErrorRecordException\r\n    + FullyQualifiedErrorId :
ScriptMethodRuntimeException\r\n \r\n", "module_stdout": "", "msg": "MODULE
FAILURE", "operation": "file_copy", "original_basename": "ansible.cfg",
"rc": 1, "size": 182, "src": "/ansible/ansible.cfg"}

fatal: [100.xxx]: FAILED! => {"changed": false, "checksum":
"8d13b59b96713e8ff23461fba04ca45bf53b1db7", "dest":
"C:\\Users\\YRunner\\Desktop\test1", "module_stderr": "Exception calling
\"Run\" with \"1\" argument(s): \"Exception calling \"Invoke\" with \"0\"
argument(s): \"The running command \r\nstopped because the preference
variable \"ErrorActionPreference\" or common parameter is set to Stop:
Illegal characters \r\nin path.\"\"\r\nAt line:65 char:5\r\n+     $output =
$entrypoint.Run($payload)\r\n+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n
  + CategoryInfo          : NotSpecified: (:) [],
ParentContainsErrorRecordException\r\n    + FullyQualifiedErrorId :
ScriptMethodRuntimeException\r\n \r\n", "module_stdout": "", "msg": "MODULE
FAILURE", "operation": "file_copy", "original_basename": "ansible.cfg",
"rc": 1, "size": 182, "src": "/ansible/ansible.cfg"}

to retry, use: --limit @/ansible/playbook/test.retry


PLAY RECAP
*********************************************************************

100.xxx          : ok=1    changed=0    unreachable=0    failed=1

100.xxx          : ok=1    changed=0    unreachable=0    failed=1


This is my yml file:

---

- hosts: nuc

  tasks:

    - name: Copies file to Windows

      win_copy: src=/ansible/ansible.cfg dest=C:\Users\YRunner\Desktop\test1


Any ideas why this would fail again?




On Wed, Oct 25, 2017 at 4:48 PM, Brian Coca <[email protected]> wrote:

> I think you are misusing the directives:
>
> - hosts: /ansible/hosts <= this will NOT use that file as inventory
> for the play.
>
> The hosts keyword is supposed to be a 'pattern', not a file nor
> inventory source.
>
> to use that as your inventory you can do:
> ansible-playbook  /ansible/playbook/test.yml -i /ansible/hosts
>
> and set hosts: to 'all'
>
> - hosts: all
>
>
> --
> ----------
> Brian Coca
>
> --
> 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/CACVha7e9-yW-xCBh99O3Fb%2B%
> 3DkytJMXs5T0KxUymPG_iJ5Leauw%40mail.gmail.com.
> 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/CADxK1ktRZXshA%2BE0qOF2Gjf48E0j-C6wxFSeWdanLaHRN%3DNcmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to