From 6bf013faa8ced9ec8def7bc70ac9ff5ce59b3265 Mon Sep 17 00:00:00 2001 From: Viktor Berke Date: Wed, 29 Nov 2023 18:03:05 +0100 Subject: [PATCH] APT cache fix --- tasks/apt_cache.yml | 5 +++++ tasks/main.yml | 4 +++- tasks/update.yml | 6 ------ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 tasks/apt_cache.yml delete mode 100644 tasks/update.yml diff --git a/tasks/apt_cache.yml b/tasks/apt_cache.yml new file mode 100644 index 0000000..a0d6325 --- /dev/null +++ b/tasks/apt_cache.yml @@ -0,0 +1,5 @@ +--- +- name: Update APT cache + apt: + update_cache: true + register: noobient_apt_cache_updated diff --git a/tasks/main.yml b/tasks/main.yml index 528fea9..f73adb6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,7 @@ --- -- include_tasks: update.yml +- include_tasks: apt_cache.yml + when: ansible_pkg_mgr == 'apt' and noobient_apt_cache_updated is not defined + - include_tasks: unixcred.yml - include_role: diff --git a/tasks/update.yml b/tasks/update.yml deleted file mode 100644 index aee62f4..0000000 --- a/tasks/update.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Update APT cache - apt: - update_cache: true - register: updated_apt_cache - when: ansible_os_family == 'Debian' and updated_apt_cache is not defined