From bb81c5f3f80222bdb3e0f54aa48b35e29c39c322 Mon Sep 17 00:00:00 2001 From: Viktor Berke Date: Wed, 29 Nov 2023 18:04:42 +0100 Subject: [PATCH] Consistency --- tasks/apt_cache.yml | 5 +++++ tasks/main2.yml | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 tasks/apt_cache.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/main2.yml b/tasks/main2.yml index 5ae8716..7737426 100644 --- a/tasks/main2.yml +++ b/tasks/main2.yml @@ -1,9 +1,6 @@ --- -- name: Update apt cache - apt: - update_cache: true - register: noobient_nginx_apt_updated - when: (ansible_pkg_mgr == 'apt') and (noobient_nginx_apt_updated is not defined) +- include_tasks: apt_cache.yml + when: ansible_pkg_mgr == 'apt' and noobient_apt_cache_updated is not defined - include_tasks: wordpress.yml when: (noobient_nginx_wp_installed is not defined) and (mode == 'wordpress')