I’m facing with an issue and I cannot find the reason for this behaviour of ansible:
My hosts file (part of it):
[lb]
lb[1:2]
lb3
The result in command line:
ansible -a whoami lb
lb1 | success | rc=0 >>
root
lb2 | success | rc=0 >>
root
lb3 | success | rc=0 >>
root
In my opinion the above command should check only lb1 and lb2, as lb3 is not the part of the lb group.
Can anyone tell me why it’s catching the 3rd lb node?
Strange thing is if I’m removing the lb3 from it’s current place in the hosts file and placing it somewhere else, then the issue is gone, for example:
[lb]
lb[1:2]
[payment]
payment[1:3]
lb3
I think parsing the hosts file is wrong in ansible in this case.
Thanks.