clean up some only_if's to make them 'when's and easier to read

This commit is contained in:
Seth Vidal 2013-07-05 17:15:37 +00:00
parent d32bf1cc9d
commit 28a68eec6c
3 changed files with 6 additions and 6 deletions

View file

@ -13,20 +13,20 @@
- name: tell nagios to shush - name: tell nagios to shush
action: nagios action=silence host=${inventory_hostname_short} action: nagios action=silence host=${inventory_hostname_short}
delegate_to: noc01.phx2.fedoraproject.org delegate_to: noc01.phx2.fedoraproject.org
only_if: "'${needsreboot.stdout}'.find('yes') != -1" when:"'yes' in needsreboot.stdout"
- name: reboot the host - name: reboot the host
action: command /sbin/reboot 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 - name: wait for host to come back - up to 6 minutes
local_action: wait_for host=${inventory_hostname} port=22 delay=30 timeout=420 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 - name: tell nagios to unshush
action: nagios action=unsilence host=${inventory_hostname_short} action: nagios action=unsilence host=${inventory_hostname_short}
delegate_to: noc01.phx2.fedoraproject.org delegate_to: noc01.phx2.fedoraproject.org
only_if: "'${needsreboot.stdout}'.find('yes') != -1" when:"'yes' in needsreboot.stdout"

View file

@ -20,7 +20,7 @@
- name: run rkhunter --propupd - name: run rkhunter --propupd
action: command /usr/bin/rkhunter --propupd action: command /usr/bin/rkhunter --propupd
only_if: "'${rkhunter.rc}' == '0'" when: rkhunter|success

View file

@ -33,7 +33,7 @@
- name: run rkhunter --propupd - name: run rkhunter --propupd
action: command /usr/bin/rkhunter --propupd action: command /usr/bin/rkhunter --propupd
only_if: "'${rkhunter.rc}' == '0'" when: rkhunter|success