]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Use a targets var to optionally define hosts for each playbook wip-playbook-host-vars 71/head
authorAndrew Schoen <aschoen@redhat.com>
Thu, 9 Jul 2015 14:22:38 +0000 (09:22 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 9 Jul 2015 14:22:38 +0000 (09:22 -0500)
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>
ansible_managed.yml
cobbler.yml
downstream_setup.yml
puddle.yml
testnodes.yml
users.yml

index fa402926641b090bb82349672a849d7e5de09e63..405f5da6e349826282aa2c662d180fd26cac7035 100644 (file)
@@ -1,7 +1,7 @@
 ---
 # 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:
index 687c0a112967abbc05d08b8e3c1f99566d6b2287..3a6660955c9790c746f6b4d0adaae347243c4978 100644 (file)
@@ -1,5 +1,5 @@
 ---
-- hosts: cobbler 
+- hosts: "{{ targets | default('cobbler') }}"
   roles:
     - common
     - cobbler 
index 8de896d153601670fe8725b26ee986a9a5e21b96..bc2484971eba103e54a3c40e4965e0bea933a744 100644 (file)
@@ -1,6 +1,6 @@
 ---
 # A playbook used to setup a node for downstream
 # RHCeph testing.
-- hosts: testnodes
+- hosts: "{{ targets | default('testnodes') }}"
   roles:
     - downstream-setup
index d339368f5aaf11bd8fa7920ba8f190c730392253..6239e5c18867d15f16970a7ac349033bd9c12b78 100644 (file)
@@ -1,5 +1,5 @@
 ---
-- hosts: puddle
+- hosts: "{{ targets | default('puddle') }}"
   roles:
     - common
     - puddle
index 0c93be257846815310fbfbd1a6732b0ef6d8f30a..200cb1905be4c296fce488c25205760713a55db8 100644 (file)
@@ -1,5 +1,5 @@
 ---
-- hosts: testnodes
+- hosts: "{{ targets | default('testnodes') }}"
   roles:
     - common
     - testnode
index 550500122800f823886e29116e637ce7780da5c2..98cdec5c4df4d5f45597e7e20b2cb47b508aa870 100644 (file)
--- a/users.yml
+++ b/users.yml
@@ -1,4 +1,4 @@
 ---
-- hosts: all
+- hosts: "{{ targets | default('all') }}"
   roles:
     - users