reconfig role update and upgrade with autoremove

This commit is contained in:
Ruben Blanco 2023-12-19 16:42:11 +01:00
parent fa7c08d3e9
commit f898e9263c
1 changed files with 19 additions and 16 deletions

View File

@ -1,27 +1,30 @@
--- ---
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# update packages # step1 - run apt-get update
- name: update packages - name: update index of all packages
ansible.builtin.apt:
update_cache: true
force_apt_get: true
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# step2 - run apt-get update
- name: update all packages to their latest version
ansible.builtin.apt: ansible.builtin.apt:
name: "*" name: "*"
state: latest state: latest
update_cache: true
force_apt_get: true force_apt_get: true
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # step3 - run apt-get full-upgrade
# upgrade packages - name: upgrade the OS (apt-get dist-upgrade)
- name: upgrade packages
ansible.builtin.apt: ansible.builtin.apt:
upgrade: dist upgrade: dist
state: latest
force_apt_get: true force_apt_get: true
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# step4 - run apt autoremove
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - name: autoremove packages unused dependency packages
# autoremove packages , remove unused dependency packages
- name: autoremove packages
ansible.builtin.apt: ansible.builtin.apt:
autoremove: true autoremove: true
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ force_apt_get: true
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++