On Mon, May 04, 2020 at 10:49:38PM +0200, Vladimir Botka wrote: > On Mon, 4 May 2020 22:31:49 +0200 > Kai Stian Olstad <[email protected]> wrote: > > > > [test_group] > > > host1 > > > host2 > > > > Since you have two host you will have two tasks that tries to write to the > > same > > file at the same time, and only one of them will win. > > > > Add "throttle: 1" to you lineinfile task and it will work. > > I don't need "throttle" with 2.9.6. The playbook > > shell> cat pb.yml > - hosts: > - test_01 > - test_02 > gather_facts: false > tasks: > - lineinfile: > path: test-file > line: "{{ inventory_hostname }}" > delegate_to: localhost
That is just pure luck, try running it 100 times and count how many times it fails. -- Kai Stian Olstad -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20200504210650.4vtsrtlmmkwokdfm%40olstad.com.
