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: I2b6b06e0986bc072758f2a5b4d692248143bd300
This commit is contained in:
Jean-Philippe Evrard 2016-11-04 16:51:01 +00:00
parent ecde7003dc
commit b49c2bf245

View File

@ -64,6 +64,7 @@
apt_repository:
repo: "{{ haproxy_repo.repo }}"
state: "{{ haproxy_repo.state }}"
update_cache: yes
when:
- haproxy_repo.repo is defined
- haproxy_repo.state is defined
@ -73,12 +74,3 @@
delay: 2
tags:
- haproxy-repos
- name: Update apt if necessary
apt:
update_cache: yes
when: add_repos|changed
tags:
- haproxy-repos
# don't trigger ANSIBLE0016
- skip_ansible_lint