2023-12-19 13:33:02 +00:00
|
|
|
---
|
|
|
|
|
2024-02-15 10:49:06 +00:00
|
|
|
- name: "[CONFIG UPDATE] Comprobando si es necesario realizar update "
|
|
|
|
meta: end_host
|
|
|
|
when: update_enabled is not defined or not update_enabled
|
|
|
|
|
2023-12-19 15:42:11 +00:00
|
|
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# step1 - run apt-get update
|
|
|
|
- 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
|
2023-12-19 13:33:02 +00:00
|
|
|
ansible.builtin.apt:
|
|
|
|
name: "*"
|
|
|
|
state: latest
|
|
|
|
force_apt_get: true
|
2023-12-19 15:42:11 +00:00
|
|
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# step3 - run apt-get full-upgrade
|
2023-12-19 15:49:38 +00:00
|
|
|
- name: upgrade the OS (apt-get full-upgrade)
|
2023-12-19 13:33:02 +00:00
|
|
|
ansible.builtin.apt:
|
2023-12-19 15:49:38 +00:00
|
|
|
upgrade: full
|
2023-12-19 13:33:02 +00:00
|
|
|
force_apt_get: true
|
2023-12-19 15:42:11 +00:00
|
|
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
# step4 - run apt autoremove
|
|
|
|
- name: autoremove packages unused dependency packages
|
2023-12-19 14:00:23 +00:00
|
|
|
ansible.builtin.apt:
|
|
|
|
autoremove: true
|
2023-12-19 15:42:11 +00:00
|
|
|
force_apt_get: true
|
|
|
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|