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:
Jean-Philippe Evrard 2016-11-04 16:50:44 +00:00
parent c0a1550cbe
commit f3cebd1f1d
1 changed files with 1 additions and 7 deletions

View File

@ -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 }}"