From 11f66a8d36e01ddfa1f496085e88eadef5e24373 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 1 May 2020 10:05:07 +0200 Subject: [PATCH] Move autoremove after remove Running `autoremove` after `remove` means we clean up any dependencies that might be left behind after removing a package. Doing it the other way means we might leave dependencies behind after running this role, and you have to run the role multiple times to clear them out. --- tasks/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 9393b33..77a9b78 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -82,16 +82,6 @@ - apt - apt-clean -- name: autoremove - apt: - autoremove: true - dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" - when: apt_autoremove - tags: - - configuration - - apt - - apt-autoremove - - name: install apt: name: "{{ apt_install }}" @@ -110,3 +100,13 @@ - configuration - apt - apt-remove + +- name: autoremove + apt: + autoremove: true + dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" + when: apt_autoremove + tags: + - configuration + - apt + - apt-autoremove