Hi all.
As a beginner, one of the first playbooks I am developing is to copy a file
from a network drive to the windows host.
[warken1@ansible-controller windows-projects]$ ansible --version
ansible 2.9.7
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/warken1/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Nov 21 2019, 19:31:34) [GCC 8.3.1
20190507 (Red Hat 8.3.1-4)]
The playbook file_TU_copy.yml:
---
- name: Copying a file to Windows host
gather_facts: no
hosts: win
tasks:
- name: Copy TU.exe file
win_copy:
src: 'Z:\TU\TestUniverseLabel.png'
remote_src: yes
dest: 'C:\TU\TestUniverseLabel.png'
The error returning is this:
[warken1@ansible-controller windows-projects]$ ansible-playbook -i
inventory file_TU_copy.yml
PLAY [Copying a file to Windows host]
********************************************************************************************
TASK [Copy TU.exe file]
**********************************************************************************************************
fatal: [win-node1]: FAILED! => {"changed": false, "dest":
"C:\\TU\\TestUniverseLabel.png", "msg": "Cannot copy src file:
'Z:\\TU\\TestUniverseLabel.png' as it does not exist", "src":
"Z:\\TU\\TestUniverseLabel.png"}
PLAY RECAP
***********************************************************************************************************************
win-node1 : ok=0 changed=0 unreachable=0 failed=1
skipped=0 rescued=0 ignored=0
Some details about the "infrastructure" behind this :) Both ansible and
windows hosts are VMs available in a VMware Workstation. I shared a host
folder (this is the network drive), so the windows VM has access to it. I
can copy, move, delete, etc files from inside the windows VM. Not sure if
that is something to consider thou related to the ansible VM...
Any light over my brain is really appreciated for my next steps.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/3d481759-3542-420b-bae9-80aee106d73c%40googlegroups.com.