set debian repository based on major version only

Only update apt-cache when needed

Instead of always updating the apt cache, leverage the 'update_cache'
method during the apt install task.  Prior to this patch, every run of
this role resulted in a "changed" state.  This patch will clean up that
report to only be "changed" when this actually did indeed change (as
updating the apt-cache isn't a meaningful "change").

use apt_repository instead of file copy
master
Nicholas E. Rabenau 9 years ago
parent d71408980d
commit 31dc523832

@ -1 +0,0 @@
deb https://apt.dockerproject.org/repo debian-jessie main

@ -12,13 +12,16 @@
id: "{{ docker_gpg_key }}"
keyserver: "{{ key_server }}"
- name: ensure repo is present
copy:
src: "repos/{{ ansible_distribution }}-{{ ansible_distribution_version }}"
dest: /etc/apt/sources.list.d/docker.list
- name: ensure docker repo is present
apt_repository:
repo: deb https://apt.dockerproject.org/repo debian-jessie main
state: present
filename: docker
update_cache: true
- name: ensure docker is installed
apt:
name: docker-engine
state: present
update_cache: yes
update_cache: true
cache_valid_time: 3600

Loading…
Cancel
Save