Hi guys,
Anyone know if you can completely override the hosts: value in a playbook?
I don’t use inventory files so I always just have this set to ‘all’. But when I call a playbook from another playbook like this, for example:
Playbook1
-
name: Format EBS volumes
hosts: ec2_group # coming from the ec2 module and add_host
… -
include: playbook2.yml hosts=ec2_group
or
- { include: playbook2.yml, hosts: ec2_group }
It works but then it also tries to run the playbook to the ‘all’ group (which is everything in my default hosts file). I want the ‘all’ value to be completely overridden by the new value I specified.
Is there a better way to do this without creating an inventory file?
Thanks