From 28a68eec6c102f8f3e9335c00cb50ffe10b5ac49 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Fri, 5 Jul 2013 17:15:37 +0000 Subject: [PATCH] clean up some only_if's to make them 'when's and easier to read --- playbooks/host_reboot.yml | 8 ++++---- playbooks/package_update.yml | 2 +- playbooks/vhost_update.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/host_reboot.yml b/playbooks/host_reboot.yml index d345783319..4619dcdaec 100644 --- a/playbooks/host_reboot.yml +++ b/playbooks/host_reboot.yml @@ -13,20 +13,20 @@ - name: tell nagios to shush action: nagios action=silence host=${inventory_hostname_short} delegate_to: noc01.phx2.fedoraproject.org - only_if: "'${needsreboot.stdout}'.find('yes') != -1" + when:"'yes' in needsreboot.stdout" - name: reboot the host action: command /sbin/reboot - only_if: "'${needsreboot.stdout}'.find('yes') != -1" + when:"'yes' in needsreboot.stdout" - name: wait for host to come back - up to 6 minutes local_action: wait_for host=${inventory_hostname} port=22 delay=30 timeout=420 - only_if: "'${needsreboot.stdout}'.find('yes') != -1" + when:"'yes' in needsreboot.stdout" - name: tell nagios to unshush action: nagios action=unsilence host=${inventory_hostname_short} delegate_to: noc01.phx2.fedoraproject.org - only_if: "'${needsreboot.stdout}'.find('yes') != -1" + when:"'yes' in needsreboot.stdout" diff --git a/playbooks/package_update.yml b/playbooks/package_update.yml index 28790b4669..a47d6bf266 100644 --- a/playbooks/package_update.yml +++ b/playbooks/package_update.yml @@ -20,7 +20,7 @@ - name: run rkhunter --propupd action: command /usr/bin/rkhunter --propupd - only_if: "'${rkhunter.rc}' == '0'" + when: rkhunter|success diff --git a/playbooks/vhost_update.yml b/playbooks/vhost_update.yml index bc79064797..0ea149078b 100644 --- a/playbooks/vhost_update.yml +++ b/playbooks/vhost_update.yml @@ -33,7 +33,7 @@ - name: run rkhunter --propupd action: command /usr/bin/rkhunter --propupd - only_if: "'${rkhunter.rc}' == '0'" + when: rkhunter|success