Add update and reboot playbooks

This commit is contained in:
Ryan Cavicchioni 2022-08-30 07:29:39 -05:00
parent 375f8a0055
commit 154a71d6fe
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
2 changed files with 27 additions and 0 deletions

9
playbooks/reboot.yaml Normal file
View File

@ -0,0 +1,9 @@
---
- name: reboot all servers
hosts: all
serial: 1
tasks:
- name: Reboot
reboot:
- name: Wait for system to become reachable
wait_for_connection:

18
playbooks/update.yaml Normal file
View File

@ -0,0 +1,18 @@
---
- name: update all servers
become: true
hosts: all
tasks:
- name: Upgrade the OS (apt)
apt:
update_cache: true
upgrade: dist
when: ansible_pkg_mgr == 'apt'
- name: Upgrade the OS (dnf)
dnf:
name: '*'
state: latest
update_cache: yes
update_only: yes
when: ansible_pkg_mgr == 'dnf'