diff --git a/tasks/openjdk_deb.yml b/tasks/openjdk_deb.yml index be80d87..652af3b 100644 --- a/tasks/openjdk_deb.yml +++ b/tasks/openjdk_deb.yml @@ -53,7 +53,12 @@ file: dest: /etc/apt/sources.list.d/zulu-openjdk.list state: absent - update_cache: yes + register: zulu_repo_removal + + - name: Update the apt cache + apt: + update_cache: True + when: zulu_repo_removal is changed - name: Install the OpenJDK that comes with the distribution apt: pkg=openjdk-{{ item.0 }}-{{ item[1] }} state={{ openjdk_pkg_state }} update_cache=yes cache_valid_time=3600