diff --git a/ansible/00-install-updates.yml b/ansible/00-install-updates.yml new file mode 100644 index 0000000..2b9007a --- /dev/null +++ b/ansible/00-install-updates.yml @@ -0,0 +1,9 @@ +--- + +- name: Update the system + hosts: pibox + become: true + roles: + - role: apt-update-system + +... diff --git a/ansible/roles/apt-update-system/tasks/main.yml b/ansible/roles/apt-update-system/tasks/main.yml new file mode 100644 index 0000000..b0727c3 --- /dev/null +++ b/ansible/roles/apt-update-system/tasks/main.yml @@ -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 + +...