Hi!
I’m using the pattern outlined at https://github.com/ansible/ansible/pull/1956 to include playbooks for a limitted group of hosts. In short:
`
Hi!
I’m using the pattern outlined at https://github.com/ansible/ansible/pull/1956 to include playbooks for a limitted group of hosts. In short:
`
I figured, the variabel replacement still works fine - but for some reason the host groups are not forwarded to the included playbook anymore. E.g., in root playbook the host is in group “mygroup”, but when the included playbook runs for “mygroup” the host is not matched any more. The output is like this:
PLAY [“mygroup”] **************************************************************
skipping: no hosts matched
Ansible hasn’t used a dollar sign for variable replacement in a long time
Try
{{ hosts }}
Sure, I’ve been using {{ hosts }} - I just copied the example from the old docs - sry for that. I did some more testing and think this is a bug. I reported it with a simple example playbook at https://github.com/ansible/ansible/issues/9733
Where did you define the ‘my group’ variable?
As noted in the example over at https://github.com/ansible/ansible/issues/9733 I’m setting the host-group when including the playbook like this:
- include: test-include.yml hosts="group"
Yeah the scope is wrong on this one - You can’t do that.
If it happened to work like this before, it would be an accident
Perhaps you meant this was a playbook level include – which perhaps should.
Can we see the top level playbook in entirety?
Yes, it’s a playbook level include. It looks like the following:
`