This will allow us to pass something like --extra-vars="targets=all"
when running the testnodes playbook to allow it to use any node in the
inventory and not only those in the testnodes group.
I see this as being useful for teuthology so that when the Ansible task
creates an inventory dynamically it doesn't have to worry about trying
to match up the nodes in the inventory with what's defined in the playbook.
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
---
# a playbook to create the necessary users, groups and
# sudoer settings needed for ansible to manage a node.
-- hosts: all
+- hosts: "{{ targets | default('all') }}"
# assuming the nodes we run this on will most likely
# have an ubuntu user already created.
vars:
---
-- hosts: cobbler
+- hosts: "{{ targets | default('cobbler') }}"
roles:
- common
- cobbler
---
# A playbook used to setup a node for downstream
# RHCeph testing.
-- hosts: testnodes
+- hosts: "{{ targets | default('testnodes') }}"
roles:
- downstream-setup
---
-- hosts: puddle
+- hosts: "{{ targets | default('puddle') }}"
roles:
- common
- puddle
---
-- hosts: testnodes
+- hosts: "{{ targets | default('testnodes') }}"
roles:
- common
- testnode
---
-- hosts: all
+- hosts: "{{ targets | default('all') }}"
roles:
- users