Ansible playbook for moving files from one node to another remote node

0 votes

I'm trying to move files from one node to another remote node and would like to know to write the Ansible playbook for it.

Also to be sure, I'm trying to move files not copy.

Jan 16 in Ansible by Nigya
338 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The best way to do this is:

copy file from a file to another and then delete the file from where you've moved it. Something like this:

- name: Copy files from foo to bar
  copy: remote_src=True src=/path/to/foo dest=/path/to/bar

- name: Remove old files foo
  file: path=/path/to/foo state=absent
answered Jan 16 by Nigya

edited Jan 18 by Vardhan

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Trying to execute bash script using Ansible one one node

You could make your task an asynchronous action by ...READ MORE

answered Jan 28 in Ansible by Kavya
40 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Ansible playbbok to copy files from one node to another remote node

You can create a playbook for copying ...READ MORE

answered Jan 16 in Ansible by Danica
43 views
+1 vote
4 answers

Pass variable to ansible playbook through command line

ansible-playbook test.yml --extra-vars "arg1=${var1} arg2=${var2}" Use is like ...READ MORE

answered May 7 in Ansible by Bobin
1,120 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.