Hi all,
I’m attempting to use a technique for limiting hosts in playbook includes described in an older thread ( https://groups.google.com/forum/#!msg/ansible-project/7Yb4zmZPg8c/b646JLYpJccJ ), and it’s mostly working, except for one thing. I have a playbook that includes another like this:
- include: other_playbook.yml limit_hosts=a_group
In that included playbook, my hosts lines are all like this:
- hosts: target_group:&{{ limit_hosts }}
which works great for limiting the included playbook tasks to the passed in group. However, I also need to be able to run that included playbook separately, at which point I need to set limit_hosts to ‘all’ for normal operation. I can do this on the command line with -e, or in a vars section, but the best place to put it (which would make things ‘just work’) seems to me to be my group_vars/all file, but that’s the one place that doesn’t work. Should it? Is there a better way to do this? I’m running a fairly recent ansible dev version ( 078aaa9 ), and have also tried with the latest as of this post ( f31cb7c ).
Nathan