blob: 97bfb7c4e8810b1b25f1629264245dde75293caa [file] [log] [blame]
Zack Williams961d3692016-05-01 09:24:30 -07001---
2# roles/apt-cacher-ng/tasks
3
4- name: Install apt-cacher-ng with apt
5 apt:
Zack Williams275e48b2017-03-24 12:16:00 -07006 name: "{{ item }}"
7 update_cache: yes
8 cache_valid_time: 3600
Zack Williams961d3692016-05-01 09:24:30 -07009 with_items:
10 - apt-cacher-ng
11
12- name: Configure apt-cacher-ng to pass through ssl repos
13 when: apt_ssl_sites is defined
14 lineinfile:
15 'dest=/etc/apt-cacher-ng/acng.conf
16 insertafter="^# PassThroughPattern"
17 regexp="^PassThroughPattern"
18 line="PassThroughPattern: ({{ apt_ssl_sites | join(\"|\")}}):443$"'
19 notify:
20 restart apt-cacher-ng
21
22- name: Configure local system to use apt-cacher-ng
23 template:
Zack Williams275e48b2017-03-24 12:16:00 -070024 src: "{{ item }}.j2"
25 dest: "/etc/apt/apt.conf.d/{{ item }}"
26 owner: root
27 group: root
28 mode: "0644"
29 with_items:
30 - 02broken-repos
31 - 03apt-cacher-ng
Zack Williams961d3692016-05-01 09:24:30 -070032