-3

I have folder which is having lot of files and i need to compare it from one server to another server. If the file is not on the destination server then need to copy the same. Can you please help in writing ansible playbook to do the same thing.

For example: A server is having 100 files and I need to compare this into B server and if any file missing then copy to B server. I need to write this in Ansible, please help. Thanks, Raghu

  • 1
    Break down the problem into smaller parts. Can you write a program that compares one file with another? Can you write a program that copies one file from server A to server B? Show us that at least. We can't do all your homework for you. – Stephan Branczyk Nov 16 '19 at 23:05
  • Stephan, thanks for your help. I am working on that like you said. I will update the status. – vbraghu Nov 19 '19 at 01:32

1 Answers1

1

You should use synchronize module for that kind of task.

sebthebert
  • 12,196
  • 2
  • 26
  • 37