From: Michael Jeanson Date: Fri, 9 Aug 2024 18:02:32 +0000 (-0400) Subject: ansible: modernize dist-upgrade playbook X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d0393040e28c512a829e56f859e583a7528fd022;p=lttng-ci.git ansible: modernize dist-upgrade playbook Use ansible.builtin.apt in a single operation. Change-Id: Iaccd7a5aaa90fdfd5bb68ee16ef092ea1132b830 Signed-off-by: Michael Jeanson --- diff --git a/automation/ansible/playbooks/dist-upgrade.yml b/automation/ansible/playbooks/dist-upgrade.yml index 57d011d..9d01aa1 100644 --- a/automation/ansible/playbooks/dist-upgrade.yml +++ b/automation/ansible/playbooks/dist-upgrade.yml @@ -1,5 +1,5 @@ --- -- name: Dist upgrade and optional reboot +- name: "Dist upgrade and optional reboot" hosts: all vars: restart: 'no' @@ -12,20 +12,16 @@ private: no tasks: - - name: apt-get update - apt: update_cache=yes cache_valid_time=3600 + - name: "apt update && apt dist-upgrade && apt clean && apt autoremove --purge" + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 3600 + upgrade: dist + clean: yes + autoremove: yes + purge: yes - - name: apt-get dist-upgrade - apt: upgrade=dist - - - name: apt-get autoremove - command: - cmd: apt-get -y --purge autoremove - warn: false - register: autoremove_output - changed_when: "'The following packages will be REMOVED' in autoremove_output.stdout" - - - name: reboot server + - name: "Reboot server" command: /sbin/reboot async: 0 poll: 0