blob: 410d757fd2bc02cbbf71d292a7c0eacf93f55c7f [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Zack Williams961d3692016-05-01 09:24:30 -070017---
18# roles/apt-cacher-ng/tasks
19
20- name: Install apt-cacher-ng with apt
21 apt:
Zack Williams275e48b2017-03-24 12:16:00 -070022 name: "{{ item }}"
23 update_cache: yes
24 cache_valid_time: 3600
Zack Williams961d3692016-05-01 09:24:30 -070025 with_items:
26 - apt-cacher-ng
27
28- name: Configure apt-cacher-ng to pass through ssl repos
29 when: apt_ssl_sites is defined
30 lineinfile:
31 'dest=/etc/apt-cacher-ng/acng.conf
32 insertafter="^# PassThroughPattern"
33 regexp="^PassThroughPattern"
34 line="PassThroughPattern: ({{ apt_ssl_sites | join(\"|\")}}):443$"'
35 notify:
36 restart apt-cacher-ng
37
38- name: Configure local system to use apt-cacher-ng
39 template:
Zack Williams275e48b2017-03-24 12:16:00 -070040 src: "{{ item }}.j2"
41 dest: "/etc/apt/apt.conf.d/{{ item }}"
42 owner: root
43 group: root
44 mode: "0644"
45 with_items:
46 - 02broken-repos
47 - 03apt-cacher-ng
Zack Williams961d3692016-05-01 09:24:30 -070048