Ansible lineinfile module to update a same file simultaneously

147 Views Asked by At

I have a ansible playbook which executes specific tasks on remote nodes and update a file on localhost (master server) using lineinfile and delegate to localhost. If the execution happens simultaneously on remote hosts, the file is getting updated for few hosts and not for others.

I think, it might be due to open file, when a task is using that file from one server, then the other server can't use it. Is there a way to fix this?

1

There are 1 best solutions below

0
Nega On

Dumping the contents to separate files and merging the file can be done as a workaround