diff --git a/playbooks/reboot.yaml b/playbooks/reboot.yaml new file mode 100644 index 0000000..c7261e6 --- /dev/null +++ b/playbooks/reboot.yaml @@ -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: diff --git a/playbooks/update.yaml b/playbooks/update.yaml new file mode 100644 index 0000000..4650c1f --- /dev/null +++ b/playbooks/update.yaml @@ -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'