add update-playbook (#631)
Reviewed-on: #631 Co-authored-by: Michael Grote <michael.grote@posteo.de> Co-committed-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
parent
bc754e8b42
commit
33faf8b188
1 changed files with 21 additions and 0 deletions
21
playbooks/on-off/update.yml
Normal file
21
playbooks/on-off/update.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- 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'))
|
Loading…
Reference in a new issue