main.yml 265 B

12345678910111213141516
  1. ---
  2. - name: Update all packages
  3. package:
  4. name: '*'
  5. state: latest
  6. register: result
  7. until: result is succeeded
  8. - when:
  9. - os_update_latest_reboot
  10. - result.changed
  11. block:
  12. - shell: ( sleep 2 && reboot ) &
  13. - wait_for_connection:
  14. delay: 10