This ought to do it (not tested).
Jon
---
- hosts: windows
tasks:
- name: copy file back to ansible machine from windows
fetch:
src: \path\to\file\on\windows\machine
dest: /destination/directory/on/ansible/controller
flat: yes
delegate_to: a_windows_host
On Wednesday, November 9, 2016 at 1:25:34 PM UTC, Vigneshwar V wrote:
>
> Can you tell me what are the changes you made
>
> On Tuesday, 26 April 2016 09:43:06 UTC+5:30, Mick st john wrote:
>>
>> I did some changes and it worked. But, the whole directory is getting
>> created on the linux machine which has the desired file.
>>
>>
>> On Tuesday, April 26, 2016 at 9:34:12 AM UTC+5:30, Mick st john wrote:
>>>
>>> I tried the following playbook:
>>>
>>> ---
>>> - hosts: windows
>>> tasks:
>>> - name: copy file
>>> fetch: src=\path\to\file\on\windows\machine
>>> dest=/destination/directory
>>>
>>> But, somehow it failed. Am I doing it the wrong way?
>>>
>>> On Monday, April 25, 2016 at 8:24:58 PM UTC+5:30, J Hawkesworth wrote:
>>>>
>>>> Fetch can also fetch from windows machines back to your ansible
>>>> controller machine.
>>>>
>>>> If you are fetching from > 1 windows box don't forget to fetch to a
>>>> directory, or use something like {{ inventory_hostname_short }} when
>>>> generating the file name.
>>>>
>>>> Hope this helps,
>>>>
>>>> Jon
>>>>
>>>>
>>>> On Monday, April 25, 2016 at 3:06:04 PM UTC+1, Mick st john wrote:
>>>>>
>>>>> I trying to copy files from a remote windows machine to my local
>>>>> machine(linux machine) using ansible. As fetch module works for linux to
>>>>> linux file transfer, is there anything similar that could enable me to
>>>>> fetch files from windows machine to linux machine?
>>>>>
>>>>
--
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/3659cb2e-a379-488d-85f1-cc281b8316a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.