Force a update-cache after adding an apt gpg key.

This commit is contained in:
Andrea Dell'Amico 2018-07-17 13:14:10 +02:00
parent d2d855ab06
commit 8b3a2d84e9
1 changed files with 6 additions and 1 deletions

View File

@ -20,9 +20,14 @@
- name: Install the mongodb apt key
apt_key: keyserver="hkp://keyserver.ubuntu.com:80" id={{ mongodb_repo_key }} state=present
when: mongodb_install_from_external_repo
register: apt_key_update_cache
- name: Update the apt cache after adding a new key
apt: update_cache=yes
when: apt_key_update_cache is changed
- name: Remove the old mongo apt repositories
apt_repository: repo="{{ item }}" state=absent
apt_repository: repo="{{ item }}" state=absent update_cache=yes
with_items: '{{ mongodb_old_repositories }}'
when: mongodb_upgrade_from_older_version