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, 2019 in Ansible by Nigya
9,548 views

1 answer to this question.

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, 2019 by Nigya

edited Jan 18, 2019 by Vardhan

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

How to copy multiple files to remote system using Ansible Playbook?

Hi@akhtar, You can use the copy module in ...READ MORE

answered Sep 16, 2020 in Ansible by MD
• 95,460 points
11,244 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,041 views
+2 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, 2019 in Ansible by Danica
4,174 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP