reboot.yml 424 B

123456789101112131415
  1. ---
  2. - name: Check if a reboot is needed on all servers
  3. register: reboot_required_file
  4. stat: path=/var/run/reboot-required get_md5=no
  5. - name: Reboot the box if kernel updated
  6. reboot:
  7. msg: "Reboot initiated by Ansible for kernel updates"
  8. connect_timeout: 5
  9. reboot_timeout: 300
  10. pre_reboot_delay: 0
  11. post_reboot_delay: 30
  12. test_command: uptime
  13. throttle: 1
  14. when: reboot_required_file.stat.exists