Add update and reboot playbooks
This commit is contained in:
parent
375f8a0055
commit
154a71d6fe
9
playbooks/reboot.yaml
Normal file
9
playbooks/reboot.yaml
Normal 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
18
playbooks/update.yaml
Normal 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'
|
Loading…
Reference in New Issue
Block a user