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')