On Mon, May 04, 2020 at 11:19:53PM +0200, Vladimir Botka wrote:
> On Mon, 4 May 2020 13:26:41 -0700 (PDT)
> Justin Nelson <[email protected]> wrote:
>
> > The file contents after that pass are:
> >
> > 1 macs:
> > 2 test-host222: ab:09:87:65:43:21
> >
> > With the file contents now the following:
> >
> > 1 macs:
> > 2 test-host222: ab:09:87:65:43:21
> > 3 test-host111: 12:34:56:78:90:ab
>
> Bingo! I'm able to reproduce the problem with Ansible running on controller
> with Python 2.7
>
<snip />
> There is no such problem with Ansible running on controller with Python 3
That's just not true, your test method is flawed, you need to test it more than
one time.
$ ansible-playbook --version | awk 'NR==1; END{print}'
ansible-playbook 2.9.7
python version = 3.7.5 (default, Apr 19 2020, 20:18:17) [GCC 9.2.1 20191008]
$ cat test.yml
- hosts: a1,a2
tasks:
- lineinfile:
path: /tmp/txt
line: "{{ inventory_hostname }}"
delegate_to: localhost
$ for i in {1..100}; do >/tmp/txt; ansible-playbook test.yml &>/dev/null;
md5sum /tmp/txt; done | sort | uniq -c | sort -n
4 763950971c8c6d8df8a87a1e752799a9 /tmp/txt
11 1597a5a9948014489de663c8fb4438db /tmp/txt
36 ac34af7b876f793d09a2225e23f43088 /tmp/txt
49 317f53fd9236220d0ab65e4aac4b3c5a /tmp/txt
So as you can see I get 4 different result as expected.
$ cat a1; md5sum a1
a1
763950971c8c6d8df8a87a1e752799a9 a1
$ cat a2; md5sum a2
a2
1597a5a9948014489de663c8fb4438db a2
$ cat a1a2; md5sum a1a2
a1
a2
317f53fd9236220d0ab65e4aac4b3c5a a1a2
$ cat a2a1; md5sum a2a1
a2
a1
ac34af7b876f793d09a2225e23f43088 a2a1
--
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/20200504220240.p55iit5icha6ui3f%40olstad.com.