2023-12-19 10:55:47 +01:00
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
become: true
|
|
|
|
tasks:
|
|
|
|
- name: update apt cache
|
|
|
|
ansible.builtin.apt:
|
|
|
|
update_cache: true
|
|
|
|
|
|
|
|
- name: update installed packages
|
|
|
|
ansible.builtin.package:
|
|
|
|
upgrade: dist
|
|
|
|
register: upgrade
|
|
|
|
|
|
|
|
- name: apt autoremove
|
|
|
|
ansible.builtin.apt:
|
|
|
|
autoremove: true
|
|
|
|
clean: yes
|
|
|
|
|
|
|
|
- name: reboot
|
|
|
|
ansible.builtin.reboot:
|
|
|
|
when: (upgrade.changed and (inventory_hostname != 'pve5.mgrote.net' and inventory_hostname != 'ansible2.mgrote.net'))
|
2023-12-19 11:11:38 +01:00
|
|
|
|
|
|
|
- name: Info
|
|
|
|
ansible.builtin.debug:
|
|
|
|
msg: Pool auf pbs.mgrote.net mounten!
|
2024-01-05 14:43:57 +01:00
|
|
|
when: (upgrade.changed and inventory_hostname == 'pbs.mgrote.net')
|