bguerel.update_reboot

Header

Open Source Love Author CI Ansible Galaxy Downloads Version

Note: This is a simple role that updates and reboots systems, while checking if a reboot is needed. You can stop certain nodes from rebooting if you specify --extra-vars.

-e 'update_reboot_required_enable=false'

Requirements

  • Ansible version 2.9 or higher

Dependencies

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

Installation

  • git

Use git@github.com:bguerel/update_reboot.git to get the latest version 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

You can find the descriptions and default values for all variables in the defaults/main.yml file:

Example

Configuration

# Install required packages
update_reboot_install_pkgs: true

# Enable logging of installation packages.
update_reboot_log_enable: true

# Set the directory for log files.
update_reboot_log_directory: $HOME/.ansible/logs/UPDATE

# Enable checking for required reboot after the update.
update_reboot_required_enable: true

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

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

# Seconds to wait after reboot command success before checking if the system rebooted successfully.
update_reboot_post_delay: 10

# Seconds to wait before initiating a reboot.
update_reboot_pre_delay: 5

# Command to run on the rebooted host to check if it's ready for further tasks.
update_reboot_test_command: "uptime"

# .:EXCLUDE-PACKAGES:.

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

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

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

Playbook

You can use this in a playbook like this:

- hosts: whatever
  become: yes
  roles:
    - update_reboot

License

MIT license

Informazioni sul progetto

Update and Reboot

Installa
ansible-galaxy install bguerel.update_reboot
Licenza
Unknown
Download
1.3k
Proprietario
Deep focus on Ansible! #systemengineer, #devops, #automation, #provision