Manage Upgrades on small company step by step.
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
To make a secure upgrade check /var/run/reboot-required on Debian like Os or /usr/bin/needs-restarting on RedHat like OS.
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
any_errors_fatal: true # stop if anything is wrong
serial: 1 # one server at a time
roles:
- { role: ansible-role-manage-upgrades }
You can tests on localhost in /tests.
ansible-playbook -i inventory test.yml
also is a good solution with ansible-pull, too.
ansible ubuntu -m apt -a "upgrade=yes update_cache=yes" -b
ansible debian -m apt -a "upgrade=yes update_cache=yes" -b
ansible centos -m yum -a "name=* state=latest" -b
ansible fedora -m dnf -a "name=* state=latest" -b
ansible all -a "reboot" -s
monitor the progress with wait_for and connection: local
- rundum-updaten-mit-ansible
- ansible-apt-update-all-packages-on-ubuntu-debian-linux
- ansible-role-unattended-upgrades
- list-of-ansible-os-family-distributions-facts
- ansible-role-dnf-automatic
- ansible-role-dnf-automatic 2
- Ansible dnf module
- upgrade-reboot-linux-systems-using-ansible
- ansible role update ubuntu
- yum_update_reboot.yml
- ansible-role-upgrade
- reboot-and-wait-reboot-complete-ansible-playbook
- ansible-rolling-reboot
- ansible-rolling-update-or-deployment
- Ansible-and-rolling-upgrades
- how-to-find-out-if-my-ubuntudebian-linux-server-needs-a-reboot
- reboot-is-required-on-rhel-or-centos
- how-to-check-if-centos-rhel-needs-a-full-reboot
BSD
Tobias Kern linux system administrator