update_reboot

Header

Open Source Love Author CI Ansible Galaxy Downloads Version

Note: A simple update and reboot role with checking if a reboot is required! Although a reboot is required, you can prevent certain nodes from rebooting by using --extra-vars.

-e 'update_reboot_required_enable=false'

Requirements

  • Ansible version >= 2.9

Dependencies

  • needs-restarting (EL/Fedora)
  • needrestart (Debian/Ubuntu)
  • none (Suse)

Installation

  • git

Use [email protected]:bguerel/update_reboot.git to pull the latest edge commit of the role from git.

Platforms

EL:
  versions:
    - 9
    - 8
    - 7
Fedora:
  versions:
    - all
Debian:
  versions:
    - Bullseye
    - Buster
    - Stretch
Ubuntu:
  versions:
    - Jammy
    - Focal
    - Bionic
SLES:
  versions:
    - 15
    - 12
OpenSUSE:
  version:
    - all

Role Variables

The descriptions and default settings for all variables can be found in the defaults/main.yml directory in the following file:

Example

Configuration

# Install dependencies
update_reboot_install_pkgs: true

# Enable the logging of installation packages.
update_reboot_log_enable: true

# Directory for log files.
update_reboot_log_directory: $HOME/.ansible/logs/UPDATE

# Enable the required reboot check after the update.
update_reboot_required_enable: true

# Maximum seconds to wait for a successful connection to the managed hosts before trying again.
update_reboot_connect_timeout: 5

# Maximum seconds to wait for machine to reboot and respond to a test command.
update_reboot_timeout: 7200

# Seconds to wait after the reboot command was successful before attempting to validate the system rebooted successfully.
update_reboot_post_delay: 10

# Seconds to wait before reboot.
update_reboot_pre_delay: 5

# Command to run on the rebooted host and expect success from to determine the machine is ready for further tasks.
update_reboot_test_command: "uptime"

# .:EXCLUDE-PACKAGES:.

# Exclude packages on certain nodes from update. (RedHat)
update_reboot_redhat_exclude_pkgs:
  example-redhat-01v:
    - nginx
    - mariadb-server
    - php-fpm

# Exclude packages on certain nodes from update. (Debian)
update_reboot_debian_exclude_pkgs: []

# Exclude packages on certain nodes from update. (Suse)
update_reboot_suse_exclude_pkgs: []

Playbook

Use it in a playbook as follows:

- hosts: whatever
  become: yes
  roles:
    - update_reboot

License

MIT license

Install
ansible-galaxy install bguerel/update_reboot
GitHub repository
License
Unknown
Downloads
1203
Owner
Deep focus on Ansible! #systemengineer, #devops, #automation, #provision