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
rpa...@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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/YQBPR0101MB62463290E15B126F8E6BF23AD8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM.
Thank you for the response. I made the change but still getting the same error.
Rene
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/1322038778.164155.1638381066355%40office.mailbox.org.
* ⚠ 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.
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 }}"
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/YQBPR0101MB6246ACEDD669B20336E81623D8689%40YQBPR0101MB6246.CANPRD01.PROD.OUTLOOK.COM.