I have changed my playbook to use the sync module.  But again I am getting 
errors.    Check mode is so I can test before the actual sync.  I am using the 
ansible.posix.synchronize module which I downloaded and installed.  

Playbook
---
- name: copy file 
  hosts: source server
  gather_facts: false
  
  tasks:
    - name: "copy libraryusername.csv from source to dest"
      ansible.posix.synchronize:
        src: "/opt/odrive/alc/library/libraryusername.csv"
        dest: "rsync://destinationserver.wlu.ca/var/alc"
      delegate_to: source server
      check_mode: yes
...

The error I am getting is:

fatal: source server -> ictjobsub01.wlu.ca]: FAILED! => {"changed": false, 
"cmd": "/usr/bin/rsync --delay-updates -F --compress --dry-run --archive 
--out-format='<<CHANGED>>%i %n%L' /opt/odrive/alc/library/libraryusername.csv 
rsync://destinationserver/var/alc", "msg": "rsync: failed to connect to 
destinationserver (xx.xx.xx.xx): No route to host (113)\nrsync error: error in 
socket IO (code 10) at clientserver.c(125) [sender=3.1.2]\n", "rc": 10}

I can ssh from the source server to destination server and vice versa so not 
understanding  the no route to host issue.  

Thanks,
Rene

~

-----Original Message-----
From: ansible-project@googlegroups.com <ansible-project@googlegroups.com> On 
Behalf Of Stefan Hornburg (Racke)
Sent: December 2, 2021 4:42 AM
To: ansible-project@googlegroups.com
Subject: [EXTERNAL *] Re: [ansible-project] remote copy issue

On 01/12/2021 18:08, Rene Paquin wrote:
>
> I am attemping o copy a file from one remote linux server to two remote linux 
> servers.  My playbook is:
>
> - name: copy file
>
>   hosts: “remote source server”
>
>   gather_facts: false
>
>   tasks:
>
>     - name: "copy "
>
>       copy:
>
>         src: /opt/odrive/alc/library/libraryusername.csv
>
>         remote_src: yes
>
>         dest: /var/alc
>
>       delegate_to: destination server 1
>
>       check_mode: yes
>
>     - name: "copy "
>
>       copy:
>
>         src: /opt/odrive/alc/library/libraryusername.csv
>
>         remote_src: yes
>
>         dest: /var/alc
>
>       delegate_to: destination server 2
>
>       check_mode: yes
>
> I get the following error despite the file being there.
>
> "msg": "Source /opt/odrive/alc/library/libraryusername.csv not found"
>
> What am I missing?
>
The copy module only supports the controller or target itself (remote_src) for 
the source file.

Take a look at the synchronize module if you want copy from one target to 
another.

Regards

             Racke

> ********************************
> Rene Paquin - Systems Administrator
> Wilfrid Laurier University
> Waterloo, Ontario
> (519)884-0710 x3795
> rpaq...@wlu.ca <mailto:rpaq...@wlu.ca>
>
> -- 
> 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 ansible-project+unsubscr...@googlegroups.com 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/YQBPR0101MB62463290E15B126F8E6BF23AD8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM
>  
> <https://groups.google.com/d/msgid/ansible-project/YQBPR0101MB62463290E15B126F8E6BF23AD8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7addf104-5064-0bce-0a39-09aed56c3d6a%40linuxia.de.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/YT2PR01MB62567381F4667E1F012B0E0ED8699%40YT2PR01MB6256.CANPRD01.PROD.OUTLOOK.COM.

Reply via email to