Use apt_repository update_cache feature
With ansible 2.2, apt_repository update_cache feature has been fixed. When a new repo will be added, apt-get update will be run after the addition if update_cache is set to yes. This combined with the apt module now properly checking the cache validity, we can now have proper updating of the cache with registering variables. Change-Id: Icb10352ef319bfbc80151708393e81e7533a1f13
This commit is contained in:
parent
c0a1550cbe
commit
f3cebd1f1d
|
@ -57,6 +57,7 @@
|
|||
apt_repository:
|
||||
repo: "{{ galera_client_repo }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
register: add_repo
|
||||
until: add_repo | success
|
||||
retries: 5
|
||||
|
@ -64,13 +65,6 @@
|
|||
tags:
|
||||
- galera-client-repos
|
||||
|
||||
- name: Update apt if needed
|
||||
apt:
|
||||
update_cache: yes
|
||||
when: add_repo | changed
|
||||
tags:
|
||||
- galera-client-apt-packages
|
||||
|
||||
- name: Install galera packages
|
||||
apt:
|
||||
pkg: "{{ item }}"
|
||||
|
|
Loading…
Reference in New Issue