Skip to content

while-true-do/ansible-role-sys_update

Repository files navigation

Github (tag) Github (license) Github (issues) Github (pull requests)

Travis (com)

Ansible (min. version) Ansible (platforms) Ansible (tags)

Ansible Role: sys_update

An Ansible Role to update a system and reboot it.

Motivation

Updating a system is a very common use case during every lifecycle.

Description

This Role applies updates and reboots the system, if needed.

Requirements

Used Modules:

Installation

Install from Ansible Galaxy

ansible-galaxy install while_true_do.sys_update

Install from Github

git clone https://github.com/while-true-do/ansible-role-sys_update.git while_true_do.sys_update

Usage

Role Variables

defaults/main.yml

---
# defaults file for while_true_do.sys_update

## Package Management
wtd_sys_update_dep_packages: ""
wtd_sys_update_dep_packages_state: "present"

## Host Management
# Reboot automatically, when needed
wtd_sys_update_reboot_enabled: true
# Force reboot after every update
wtd_sys_update_reboot_msg: "System is going down to apply updates."
wtd_sys_update_reboot_timeout: "3600"
wtd_sys_update_reboot_forced: false

# Don't install additional dependencies
wtd_sys_update_update_only: false

# RedHat only
# Only Install security updates
wtd_sys_update_security_only: false

vars/CentOS.yml

---
# vars file for while_true_do.sys_update

wtd_sys_update_dep_packages: "yum-utils"

vars/RedHat.yml

---
# vars file for while_true_do.sys_update

wtd_sys_update_dep_packages: "yum-utils"

vars/Fedora.yml

---
# vars file for while_true_do.sys_update

wtd_sys_update_dep_packages: "tracer"

Example Playbook

Running Ansible Roles can be done in a playbook.

Simple

---
- hosts: all
  roles:
    - role: while_true_do.sys_update

Advanced

- hosts: all
  roles:
    - role: while_true_do.sys_update
      wtd_sys_update_reboot_forced: True
      wtd_sys_update_reboot_msg: "Go down down down..."
      wtd_sys_update_reboot_timeout: "600"

Known Issues

  1. RedHat Testing is currently not possible in public, due to limitations in subscriptions.
  2. Some services and features cannot be tested properly, due to limitations in docker.

Testing

Most of the "generic" tests are located in the Test Library.

Ansible specific testing is done with Molecule.

Infrastructure testing is done with testinfra.

Automated testing is done with Travis CI.

Contribute

Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.

See who has contributed already in the kudos.txt.

License

This work is licensed under a BSD-3-Clause License.

Contact