From 0b9163b4917e25625ca9eb0d69d35a0ed473c47e Mon Sep 17 00:00:00 2001 From: Junior Cabada Date: Wed, 5 Nov 2025 18:03:14 +0000 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20update-ubuntu.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update-ubuntu.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 update-ubuntu.yaml diff --git a/update-ubuntu.yaml b/update-ubuntu.yaml new file mode 100644 index 0000000..9e8dda7 --- /dev/null +++ b/update-ubuntu.yaml @@ -0,0 +1,29 @@ +--- +- name: Actualizar servidores Ubuntu 24.04 + hosts: all + become: yes + vars: + autoremove: true + reboot_after_update: true + + tasks: + - name: Actualizar caché de paquetes (apt update) + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 3600 + + - name: Realizar actualización completa (apt upgrade) + ansible.builtin.apt: + upgrade: dist + autoremove: "{{ autoremove }}" + autoclean: yes + + - name: Limpiar paquetes antiguos + ansible.builtin.apt: + name: "*" + state: latest + autoremove: yes + + - name: Mostrar el kernel actual + ansible.builtin.command: uname -r + register: kernel_version \ No newline at end of file