Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only updates apt cache if required. #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ consul_download: "https://releases.hashicorp.com/consul/{{ consul_version }}/{{
consul_download_username: ""
consul_download_password: ""
consul_download_folder: /tmp
consul_apt_cache_valid_time: 3600

consul_is_ui: false
consul_ui_archive: "consul_{{ consul_version }}_web_ui.zip"
Expand Down
7 changes: 2 additions & 5 deletions tasks/consulate.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
- name: update apt
apt: >
update_cache=yes
cache_valid_time=3600
when: ansible_os_family == "Debian"

- name: install deps (Ubuntu)
apt: >
pkg={{item}}
state=installed
update_cache=yes
cache_valid_time={{ consul_apt_cache_valid_time }}
with_items:
- python-pip
- python-dev
Expand Down
8 changes: 3 additions & 5 deletions tasks/dnsmasq.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
- name: update apt
apt:
update_cache: yes
cache_valid_time: 3600
when: ansible_os_family == "Debian"
---

- name: install deps (Ubuntu)
apt:
pkg: dnsmasq
state: installed
update_cache: yes
cache_valid_time: "{{ consul_apt_cache_valid_time }}"
when: ansible_os_family == "Debian"

- name: install deps (RHEL)
Expand Down
7 changes: 2 additions & 5 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
- name: update apt
apt: >
update_cache=yes
cache_valid_time=3600
when: ansible_os_family == "Debian"

- name: install deps (Ubuntu)
apt: >
pkg={{item}}
state=installed
update_cache=yes
cache_valid_time={{ consul_apt_cache_valid_time }}
with_items:
- unzip
- jq
Expand Down