-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtinyproxy.yml
53 lines (42 loc) · 1.28 KB
/
tinyproxy.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- hosts: tinyproxy
tasks:
- name: tinyproxy | instala paquete
apt:
name: tinyproxy
become: true
tags: [ tinyproxy, proxy ]
- name: tinyproxy | package facts
ansible.builtin.package_facts:
manager: auto
tags: [ tinyproxy, proxy ]
- name: tinyproxy | configuracion pre 1.8.4
template:
src: 'tinyproxy.conf-pre1.8.4.j2'
dest: '/etc/tinyproxy/tinyproxy.conf'
owner: 'root'
group: 'root'
mode: '0644'
become: yes
when: ansible_facts.packages['tinyproxy'][0].version is version('1.8.4', operator='le')
register: reg_tinyproxy_conf
tags: [ tinyproxy, proxy ]
- name: tinyproxy | configuracion post 1.10.0
template:
src: 'tinyproxy.conf.j2'
dest: '/etc/tinyproxy/tinyproxy.conf'
owner: 'root'
group: 'root'
mode: '0644'
become: yes
when: ansible_facts.packages['tinyproxy'][0].version is version('1.8.4', operator='gt')
register: reg_tinyproxy_conf
tags: [ tinyproxy, proxy ]
- name: tinyproxy | daemon restarted
service:
state: restarted
enabled: true
name: tinyproxy
become: true
when: reg_tinyproxy_conf is changed
tags: [ tinyproxy, proxy ]