`
inventory.yml
europe:
children:
germany:
children:
on-premise:
hosts:
127.0.0.1:
datacenter:
hosts:
127.0.0.2:
france:
children:
on-premise:
hosts:
127.0.0.3:
datacenter:
hosts:
127.0.0.4:
`
Running the following command with different --limit options:
`
ansible-playbook -i inventory.yml random-playbook.yml --limit 'some-limit
`
europeI expect to run 127.0.0.1, 127.0.0.2, 127.0.0.3, 127.0.0.4on-premiseI expect to run 127.0.0.1, 127.0.0.3datacenterI expect run 127.0.0.2, 127.0.0.4germanyI expect to run 127.0.0.1, 127.0.0.2franceI expect to run 127.0.0.3, 127.0.0.4
Now, my issue:
- Europe works as expected
- on-premise works as expected
- datacenter works as expected
- germany runs 127.0.0.1, 127.0.0.2, 127.0.0.3, 127.0.0.4
- france runs 127.0.0.1, 127.0.0.2, 127.0.0.3, 127.0.0.4
After playing with it for a while, it seemed like this behaviour is gone once you don’t have 2 on-premise or 2 datacenter children in germany and france.
It feels like while creating the host list it is just like ‘alright, france, on-premise and datacenter are children … get all the children/hosts of that group’ … after which he finds hosts in datacenter group that never belonged to France in the first place.
I was just wondering if I’m doing this wrong, or whether this is intended behaviour