Create playbook and role to update system
This commit is contained in:
parent
5e7d26a6b5
commit
9056a38e4b
9
ansible/00-install-updates.yml
Normal file
9
ansible/00-install-updates.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Update the system
|
||||||
|
hosts: pibox
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- role: apt-update-system
|
||||||
|
|
||||||
|
...
|
19
ansible/roles/apt-update-system/tasks/main.yml
Normal file
19
ansible/roles/apt-update-system/tasks/main.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: update the installed packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: true
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: update the operating system
|
||||||
|
ansible.builtin.apt:
|
||||||
|
upgrade: dist
|
||||||
|
|
||||||
|
- name: clean up apt cache
|
||||||
|
ansible.builtin.apt:
|
||||||
|
autoclean: true
|
||||||
|
autoremove: true
|
||||||
|
purge: true
|
||||||
|
|
||||||
|
...
|
Loading…
Reference in New Issue
Block a user