diff --git a/tasks/nova_compute_powervm_install.yml b/tasks/nova_compute_powervm_install.yml index b95b55fa..29d538cd 100644 --- a/tasks/nova_compute_powervm_install.yml +++ b/tasks/nova_compute_powervm_install.yml @@ -29,6 +29,7 @@ apt_repository: repo: "{{ novalink_repo.repo }}" state: "{{ novalink_repo.state }}" + update_cache: yes register: add_nv_repos until: add_nv_repos|success retries: 5 @@ -36,16 +37,6 @@ tags: - novalink-repo -- name: Update apt if needed - apt: - update_cache: yes - when: add_nv_repos|changed - tags: - - nova-apt-packages - - nova-compute-powervm-apt-packages - # do not trigger ANSIBLE0016 - - skip_ansible_lint - - name: Install apt packages apt: pkg: "{{ item }}" diff --git a/tasks/nova_install_apt.yml b/tasks/nova_install_apt.yml index 8ae7b88c..e3fc6f7b 100644 --- a/tasks/nova_install_apt.yml +++ b/tasks/nova_install_apt.yml @@ -17,6 +17,8 @@ apt: pkg: ubuntu-cloud-keyring state: "{{ nova_package_state }}" + update_cache: yes + cache_valid_time: "{{ cache_timeout }}" when: nova_uca_enable register: nova_uca_add_keys tags: @@ -26,6 +28,7 @@ apt_repository: repo: "{{ uca_repo }}" state: present + update_cache: yes register: nova_uca_add_repo when: nova_uca_enable until: add_repo|success @@ -34,13 +37,6 @@ tags: - add-uca-repo -- name: Update apt if needed - apt: - update_cache: yes - when: nova_uca_add_keys | changed or nova_uca_add_repo | changed - tags: - - nova-apt-packages - - name: Install apt packages (common) apt: pkg: "{{ item }}"