Further to this I created a quick check for file playbook as below and it does
find it and displays the content successfully. So the copy script is just not
functional. Any ideas as to why it does not find the file?
- name: check if file exists
hosts: source server
gather_facts: true
tasks:
- stat:
path: /opt/odrive/alc/library
register: result
- slurp:
src: /opt/odrive/alc/library/libraryusername.csv
register: result
when: result.stat.exists
- debug:
msg: "{{ result.content|b64decode }}"
From: [email protected] <[email protected]> On
Behalf Of Rene Paquin
Sent: December 1, 2021 12:57 PM
To: [email protected]
Subject: RE: [EXTERNAL *] Fwd: Re: [ansible-project] remote copy issue
Thank you for the response. I made the change but still getting the same error.
Rene
From: dulhaver via Ansible Project
<[email protected]<mailto:[email protected]>>
Sent: December 1, 2021 12:51 PM
To: [email protected]<mailto:[email protected]>
Subject: [EXTERNAL *] Fwd: Re: [ansible-project] remote copy issue
as far as I am aware of things delegate_to is located above the module name
tasks:
- name: "copy "
delegate_to: destination server 1
copy:
src: /opt/odrive/alc/library/libraryusername.csv
remote_src: yes
dest: /var/alc
check_mode: yes
I am still quite new to Ansible, so this is not founded on tons of experience
though.
On 12/01/2021 6:08 PM Rene Paquin <[email protected]<mailto:[email protected]>> 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?
Thank you,
********************************
Rene Paquin - Systems Administrator
Wilfrid Laurier University
Waterloo, Ontario
(519)884-0710 x3795
[email protected]<mailto:[email protected]>
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/YQBPR0101MB62463290E15B126F8E6BF23AD8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM<https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FYQBPR0101MB62463290E15B126F8E6BF23AD8689%2540YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Crpaquin%40wlu.ca%7C5f497102cdf74d7730c608d9b4f405a4%7Cb45a5125b29846bc8b89ea5a7343fde8%7C1%7C0%7C637739783366925982%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2udlz4Gk%2B3tWWsC%2Bhij9U8r1MKFRPUjXwWQjeD3uSzQ%3D&reserved=0>.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/1322038778.164155.1638381066355%40office.mailbox.org<https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F1322038778.164155.1638381066355%2540office.mailbox.org%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Crpaquin%40wlu.ca%7C5f497102cdf74d7730c608d9b4f405a4%7Cb45a5125b29846bc8b89ea5a7343fde8%7C1%7C0%7C637739783366935935%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=py0Ugtziv1a60RbKlvTBVfrCIHfyM2nokync2yAi7hU%3D&reserved=0>.
* ⚠ Notice: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know the
content is safe.
--
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]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/YQBPR0101MB6246ACEDD669B20336E81623D8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM<https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FYQBPR0101MB6246ACEDD669B20336E81623D8689%2540YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Crpaquin%40wlu.ca%7C5f497102cdf74d7730c608d9b4f405a4%7Cb45a5125b29846bc8b89ea5a7343fde8%7C1%7C0%7C637739783366945896%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=NAmu5UnOR7c87%2F9z5OVmds7UGoQUUilXeO%2BonBWAREs%3D&reserved=0>.
--
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/YQBPR0101MB6246C9679476874F2613EFD4D8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM.