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: Ic9788156a88223dc0d27fafa2a798f396135f990
This commit is contained in:
Jean-Philippe Evrard 2016-11-04 16:51:17 +00:00
parent ff9002ba36
commit 03c48e2357
4 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,7 @@
apt_repository:
repo: "deb https://packagecloud.io/grafana/stable/debian/ wheezy main"
state: "present"
update_cache: yes
- name: Install grafana
apt:
pkg: "grafana"

View File

@ -34,6 +34,7 @@
apt_repository:
repo: "deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
state: "present"
update_cache: yes
- name: Install influxdb
apt:
pkg: "influxdb"

View File

@ -26,6 +26,7 @@
apt_repository:
repo: "deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
state: "present"
update_cache: yes
- name: Install telegraf
apt:
pkg: "telegraf"

View File

@ -22,6 +22,7 @@
apt_repository:
repo: "deb https://repos.influxdata.com/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
state: "present"
update_cache: yes
- name: Install kapacitor
apt:
pkg: "kapacitor"