tell apt to use the proxy on all machines connected to the vpn
This commit is contained in:
parent
560c50fe5b
commit
614fe79fa4
5 changed files with 18 additions and 0 deletions
|
@ -1,7 +1,12 @@
|
|||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
- hosts: vpn, !tests,
|
||||
roles:
|
||||
- client_apt_proxy
|
||||
|
||||
- hosts: all, !tests,
|
||||
roles:
|
||||
- base_config
|
||||
- create_users
|
||||
- ssh_totp
|
||||
|
||||
|
|
|
@ -5,3 +5,5 @@ apt_proxy_admin_mdp: "{{ vault_apt_proxy_admin_mdp }}"
|
|||
|
||||
apt_proxy_allowed_clients:
|
||||
- "{{ intranet['ipv4'] }}/{{ intranet['netmaskv4'] }}"
|
||||
|
||||
apt_proxy_address: "{{ intranet['subnets']['physical']['subnets']['hindley']['ipv4'] }}"
|
||||
|
|
8
roles/client_apt_proxy/tasks/main.yml
Normal file
8
roles/client_apt_proxy/tasks/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: Tell apt to use the proxy
|
||||
template:
|
||||
src: "00aptproxy.j2"
|
||||
dest: "/etc/apt/apt.conf.d/00aptproxy"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '644'
|
3
roles/client_apt_proxy/templates/00aptproxy.j2
Normal file
3
roles/client_apt_proxy/templates/00aptproxy.j2
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ ansible_managed | comment }}
|
||||
Acquire::http::Proxy "http://{{ apt_proxy_address }}:{{ apt_proxy_port }}/";
|
||||
|
Loading…
Reference in a new issue