/
main.yml
35 lines (31 loc) · 1.07 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: Install requested system packages
package:
name: '{{ item }}'
state: 'present'
when: apt_proxy__deploy_state == 'present' and apt_proxy__temporally_avoid_unreachable|bool
with_flattened:
- '{{ apt_proxy__base_packages }}'
register: apt_proxy__register_packages
until: apt_proxy__register_packages is succeeded
- name: Copy get-reachable-apt-proxy to remote host
copy:
dest: '{{ apt_proxy__proxy_auto_detect }}'
src: 'usr/local/lib/get-reachable-apt-proxy'
owner: 'root'
group: 'root'
mode: '0755'
when: apt_proxy__deploy_state == 'present' and apt_proxy__temporally_avoid_unreachable|bool
- name: Remove APT proxy configuration
file:
path: '/etc/apt/apt.conf.d/{{ apt_proxy__filename }}'
state: 'absent'
when: apt_proxy__deploy_state == 'absent'
- name: Generate APT proxy configuration
template:
src: 'etc/apt/apt.conf.d/apt_proxy.conf.j2'
dest: '/etc/apt/apt.conf.d/{{ apt_proxy__filename }}'
owner: 'root'
group: 'root'
mode: '0644'
when: apt_proxy__deploy_state == 'present'