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/c8fb41ff-9ccf-4ec0-8809-b4cbefa3f463%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to