From 1af0b3eb8b4499684b0c82d81d717119dfb7dc66 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 4 Mar 2013 22:37:13 +0000 Subject: [PATCH] migrate all the script-like playbooks such that the primary host-spec is the same variable: $target --- playbooks/host-reboot.yml | 4 ++-- playbooks/package-update.yml | 4 ++-- playbooks/vhost-reboot.yml | 12 ++++++------ playbooks/vhost-update.yml | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/playbooks/host-reboot.yml b/playbooks/host-reboot.yml index f27a4b6975..e73937dbb9 100644 --- a/playbooks/host-reboot.yml +++ b/playbooks/host-reboot.yml @@ -1,7 +1,7 @@ -# requires --extra-vars="hosts=hostspec" +# requires --extra-vars="target=hostspec" - name: reboot hosts - hosts: $hosts + hosts: $target user: root serial: 1 diff --git a/playbooks/package-update.yml b/playbooks/package-update.yml index 980f8b9367..28790b4669 100644 --- a/playbooks/package-update.yml +++ b/playbooks/package-update.yml @@ -1,7 +1,7 @@ -# requires --extra-vars="hostlist='host1;host2;group etc' yumcommand=update'" +# requires --extra-vars="target='host1;host2;group etc' yumcommand=update'" - name: update all run rkhunter if installed - hosts: $hostlist + hosts: $target user: root tasks: diff --git a/playbooks/vhost-reboot.yml b/playbooks/vhost-reboot.yml index 8e427fbb7f..da4de5127d 100644 --- a/playbooks/vhost-reboot.yml +++ b/playbooks/vhost-reboot.yml @@ -1,4 +1,4 @@ -# requires --extra-vars="vhost=somevhost fqdn" +# requires --extra-vars="target=somevhost fqdn" #General overview: # talk to the vhost @@ -20,7 +20,7 @@ - name: find instances - hosts: $vhost + hosts: $target user: root tasks: @@ -57,7 +57,7 @@ - name: reboot vhost - hosts: $vhost + hosts: $target user: root tasks: @@ -65,11 +65,11 @@ action: nagios action=silence host=${inventory_hostname_short} delegate_to: noc01.phx2.fedoraproject.org - - name: halt -r the $vhost + - name: halt -r the $target action: command /sbin/reboot - - name: wait for $vhost to come back - up to 6 minutes - local_action: wait_for host=$vhost port=22 delay=120 timeout=420 + - name: wait for $target to come back - up to 6 minutes + local_action: wait_for host=$target port=22 delay=120 timeout=420 - name: tell nagios to unshush action: nagios action=unsilence host=${inventory_hostname_short} diff --git a/playbooks/vhost-update.yml b/playbooks/vhost-update.yml index 04aa5aaea3..bc79064797 100644 --- a/playbooks/vhost-update.yml +++ b/playbooks/vhost-update.yml @@ -1,7 +1,7 @@ -# requires --extra-vars="vhost=somevhostname yumcommand=update" +# requires --extra-vars="target=somevhostname yumcommand=update" - name: find instances - hosts: $vhost + hosts: $target user: root tasks: @@ -14,7 +14,7 @@ with_items: ${vmlist.list_vms} - name: update all run rkhunter if installed - hosts: $vhost;myvms_new + hosts: $target;myvms_new user: root tasks: