diff --git a/playbooks/host-reboot.yml b/playbooks/host-reboot.yml index 75bb67930f..91e855b7a6 100644 --- a/playbooks/host-reboot.yml +++ b/playbooks/host-reboot.yml @@ -6,18 +6,18 @@ tasks: - name: see if it needs to be rebooted - action: shell test -f /usr/local/bin/needs-reboot.py && /usr/local/bin/needs-reboot.py + action: command /usr/local/bin/needs-reboot.py ignore_errors: True register: needsreboot - name: reboot the host action: command touch /tmp/would-reboot #/sbin/reboot - only_if: '${needsreboot.stdout}.find("yes") != -1' + only_if: "'${needsreboot.stdout}'.find('yes') != -1" - name: wait for host to come back - up to 6 minutes local_action: wait_for host=${inventory_hostname} port=22 delay=10 timeout=420 - only_if: '${needsreboot.stdout}.find("yes") != -1' + only_if: "'${needsreboot.stdout}'.find('yes') != -1"