This is a 100% linux/unix environment, so I did not even consider win_copy, 
do you think "win_copy" will work on/for "linux to linux" ? I will 
definitely give it a try & also need permissions intact at destination, so 
I would need to insert mode for those files.


On Thursday, November 23, 2017 at 2:05:07 PM UTC-8, [email protected] 
wrote:
>
> Hi
>
> You can consider something like:
>
> win_copy:
>    src: "{{item.src}}"
>    dest: "{{item.dest}}"
> with_items:
>    - { src: path_to_src , dest: path_to_dest}
>    - { src: path_to_src , dest: path_to_dest}
>    - { src: path_to_src , dest: path_to_dest}
>
> Depending if you want to copy to linux machine or windows so then there 
> are also different modules to use in order to copy bunch of files from the 
> same location source.
> On Thursday, 23 November 2017 15:22:38 UTC+1, Love wrote:
>>
>> Hello Soniya,
>>
>> Yes,
>>
>> First I need to check if the directory exists or NOT & create it, works 
>> perfect!!
>> Second: After the above directory is created, I need to copy 3 different 
>> files from 3 different sources to 2 destinations. In other words many to 
>> many copy is NOT working for me. 
>>
>> Please let me know if its still not clear?
>>
>>
>>
>> On Monday, November 13, 2017 at 9:33:09 PM UTC-8, Soniya panwar wrote:
>>>
>>>
>>> Hello,
>>> Can you please elaborate your tasks more? 
>>> 1. In first task: you are checking if the file is exist on destination 
>>> server, and if not exist you will create new directory?
>>> 2. In second task: you are saying maven repo created but in this task 
>>> you are coping your files src to destination.
>>>
>>> if you can elaborate what is your scenario and why are you using handler 
>>> here, that will be a great help.
>>>
>>> thanks
>>> Soniya
>>>
>>>
>>> On Sunday, November 12, 2017 at 1:13:02 PM UTC+5:30, Love wrote:
>>>>
>>>> We need to be able to copy/push multiple files from multiple sources to 
>>>> multiple destinations on destination servers, I'm having trouble with 
>>>> below 
>>>> code, can anyone suggest the right syntax to update code? 
>>>>
>>>> I have 3 different files and destination is different for all of them 
>>>> and need this across my inventory, from a syntax standpoint I do not have 
>>>> any issues however, it does not push those files to destination servers.
>>>>
>>>>
>>>> --- # Deploy EP7.0 on desired servers
>>>>  - hosts: test
>>>>    remote_user: deploy
>>>>    become: yes
>>>>    become_method: sudo
>>>>    connection: ssh
>>>>    gather_facts: yes
>>>>
>>>>    tasks:
>>>>
>>>>     - name: check if maven repo exists on destination server
>>>>       file:
>>>>         path: /opt/dtv/apache-maven-3.5.0/.m2/repository
>>>>         state: directory
>>>>         owner: root
>>>>         group: root
>>>>         mode: 0755
>>>>       notify: maven repo created
>>>>
>>>>    handlers:
>>>>
>>>>     - name: maven repo created
>>>>       copy:
>>>>        src: "{{ item.src }}"
>>>>        dest: "{{ item.dest }}"
>>>>        mode: "{{ item.mode }}"
>>>>       with_items:
>>>>        - { src: '/home/psk/settings.xml',dest: 
>>>> '/opt/dtv/apache-maven-3.5.0/.m2/repository/',mode: '0755'}
>>>>        - "{ src: '/etc/ansible/roles/common/files/settings.xml' , dest: 
>>>> '/opt/dtv/apache-maven-3.5.0/conf/' , mode: '0755'}"
>>>>        - "{ src: 
>>>> '/etc/ansible/roles/common/files/archetype-catalog.xml' , dest: 
>>>> '/opt/dtv/apache-maven-3.5.0/.m2/repository/' , mode: '0755'}"
>>>>
>>>>     - debug: var=result
>>>>
>>>>

-- 
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/91c01afa-0cb1-42a0-be6d-6c9fc5deb482%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to