Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 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 Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 17 | --- |
| 18 | # roles/apt-cacher-ng/tasks |
| 19 | |
| 20 | - name: Install apt-cacher-ng with apt |
| 21 | apt: |
Zack Williams | 275e48b | 2017-03-24 12:16:00 -0700 | [diff] [blame] | 22 | name: "{{ item }}" |
| 23 | update_cache: yes |
| 24 | cache_valid_time: 3600 |
Zack Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 25 | 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 Williams | 275e48b | 2017-03-24 12:16:00 -0700 | [diff] [blame] | 40 | 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 Williams | 961d369 | 2016-05-01 09:24:30 -0700 | [diff] [blame] | 48 | |