Init
This commit is contained in:
commit
a5b7a9ab5b
5
handlers/main.yml
Normal file
5
handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: restart apt-cacher-ng
|
||||
systemd:
|
||||
name: apt-cacher-ng
|
||||
state: restarted
|
25
tasks/cacher.yml
Normal file
25
tasks/cacher.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Ensure apt-cacher-ng is present
|
||||
apt:
|
||||
name: apt-cacher-ng
|
||||
state: present
|
||||
|
||||
- name: Allow to proxy every domain
|
||||
lineinfile:
|
||||
path: /etc/apt-cacher-ng/acng.conf
|
||||
insertafter: EOF
|
||||
line: "PassThroughPattern: .*"
|
||||
notify: restart apt-cacher-ng
|
||||
|
||||
- name: Ensure apt-cacher-ng listens on all addresses
|
||||
lineinfile:
|
||||
path: /etc/apt-cacher-ng/acng.conf
|
||||
insertafter: EOF
|
||||
line: "BindAddress: 0.0.0.0"
|
||||
notify: restart apt-cacher-ng
|
||||
|
||||
- name: Ensure apt-cacher-ng is started and enabled
|
||||
systemd:
|
||||
name: apt-cacher-ng
|
||||
enabled: yes
|
||||
state: started
|
8
tasks/client.yml
Normal file
8
tasks/client.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: Ensure the client uses the cacher
|
||||
template:
|
||||
src: aptproxy.conf.j2
|
||||
dest: /etc/apt/apt.conf.d/02proxy
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
5
tasks/main.yml
Normal file
5
tasks/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- include_tasks: cacher.yml
|
||||
when: apt_cacher_ng_is_cacher is defined and apt_cacher_ng_is_cacher
|
||||
|
||||
- include_tasks: client.yml
|
1
templates/aptproxy.conf.j2
Normal file
1
templates/aptproxy.conf.j2
Normal file
|
@ -0,0 +1 @@
|
|||
Acquire::http { Proxy "http://{{ apt_cacher_ng_cacher_ip }}:3142"; };
|
Loading…
Reference in New Issue
Block a user