Skip to content

Commit

Permalink
Moved reboot_timeout to variable, added option to add post_reboot_del…
Browse files Browse the repository at this point in the history
…ay (#6)

# Pull Request Description
- Moved reboot_timeout to variable, the default stays the same as the
previous hardcoded value, but now can be adjusted
- Added option to specify post_reboot_delay, defaults to 0, so no delay
(as it previously was)

## Change type
- [ ] Bug fix (non-breaking change which fixes a specific issue)
- [x] New feature (non-breaking change adding new functionality)
- [ ] Breaking change (fix or feature that potentially causes existing
functionality to fail)
- [ ] Change that does not affect Ansible Role code (Github Actions
Workflow, Documentation, or similair)
  • Loading branch information
lukapetrovic-git authored Dec 4, 2024
1 parent fd236c2 commit 0726843
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ patch_string_to_filter_upgraded_packages: "Upgrade:"
# Reboot after upgrade if necessary
patch_reboot: true

# Seconds to wait after the reboot command was successful before attempting to validate the rebooted
patch_post_reboot_delay: 0

# Maximum seconds to wait for machine to reboot and respond to a test command.
patch_reboot_timeout: 600

# Run apt autoremove after upgrade
patch_run_autoremove: true

Expand Down
3 changes: 2 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@

- name: Reboot and wait for the machine to get back online
ansible.builtin.reboot:
reboot_timeout: 600
post_reboot_delay: "{{ patch_post_reboot_delay }}"
reboot_timeout: "{{ patch_reboot_timeout }}"
when: patch_reboot_required.stat.exists

- name: Run apt autoremove
Expand Down

0 comments on commit 0726843

Please sign in to comment.