Skip to content

Commit 738d49e

Browse files
author
Anandkumar Patel
committed
add apt back with expire time
1 parent 6105553 commit 738d49e

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
---
22
- name: install build essentials
33
sudo: true
4-
action: apt pkg="build-essential" state=present
4+
action: apt
5+
pkg="build-essential"
6+
state=present
7+
update_cache=yes
8+
cache_valid_time=604800

ansible/roles/datadog/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
apt_repository:
2121
repo='deb http://apt.datadoghq.com/ stable main'
2222
state=present
23+
update_cache=yes
24+
cache_valid_time=604800
2325

2426
- name: Create main Datadog agent configuration file
2527
tags: ['datadog']

ansible/roles/docker/tasks/main.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
apt:
1616
pkg="linux-image-extra-{{ ansible_kernel }}"
1717
state=present
18+
update_cache=yes
19+
cache_valid_time=604800
1820

1921
- name: install apt-transport-https
2022
sudo: yes
2123
apt:
2224
pkg="apt-transport-https"
2325
state=present
26+
update_cache=yes
27+
cache_valid_time=604800
2428

2529
- name: add docker repository key
2630
sudo: yes
@@ -32,8 +36,10 @@
3236
- name: add docker repository
3337
sudo: yes
3438
apt_repository:
35-
repo: "deb https://get.docker.com/ubuntu docker main"
36-
state: present
39+
repo: "deb https://get.docker.com/ubuntu docker main"
40+
state: present
41+
update_cache=yes
42+
cache_valid_time=604800
3743

3844
- name: copy docker config file
3945
sudo: yes
@@ -47,7 +53,12 @@
4753
- name: install docker
4854
sudo: yes
4955
when: restart is defined
50-
apt: pkg="{{ docker_package_name }}" state=present force=yes
56+
apt:
57+
pkg="{{ docker_package_name }}"
58+
state=present
59+
force=yes
60+
update_cache=yes
61+
cache_valid_time=604800
5162

5263
- name: restart docker
5364
when: copied_config.changed and restart is defined

ansible/roles/nginx/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
- name: install nginx
33
sudo: yes
44
apt:
5+
update_cache=yes
6+
cache_valid_time=604800
57
pkg=nginx
68
state=present
79

810
- name: install node dependencies (build-essential)
911
sudo: yes
1012
apt:
13+
update_cache=yes
14+
cache_valid_time=604800
1115
pkg=build-essential
1216
state=present
1317

@@ -32,6 +36,8 @@
3236
- name: install node
3337
sudo: yes
3438
apt:
39+
update_cache=yes
40+
cache_valid_time=604800
3541
pkg=nodejs
3642
state=present
3743

0 commit comments

Comments
 (0)