-
Notifications
You must be signed in to change notification settings - Fork 0
/
webproxies.yml
110 lines (100 loc) · 2.83 KB
/
webproxies.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
- hosts: webproxies
become: true
gather_facts: true
serial: "{{ SERIAL_COUNT | default('100%') }}"
roles:
# - base-preseed
# - { role: maintenance,
# maintenance: {
# upgrade_type: "full",
# allow_reboot: false
# }
# }
- haproxy
- varnish
- apache_httpd
handlers:
- include: roles/apache_httpd/handlers/main.yml
- include: roles/haproxy/handlers/main.yml
- include: roles/varnish/handlers/main.yml
tasks:
# HAProxy
- name: "Copy HAProxy configs"
copy:
src: "files/{{ item }}"
dest: "/etc/haproxy/haproxy.conf.d/{{ item }}"
owner: root
group: root
mode: "u=rw,g=r,o=r"
loop:
- 09-haproxy-fiona-webproxy.cfg
- 10-haproxy-plone-webproxy.cfg
notify:
- "Assemble HAProxy Config"
# Varnish
- name: "Copy Varnish configs"
copy:
src: "files/varnish-webproxy.vcl"
dest: "/etc/varnish/default.vcl"
mode: "u=rw,g=r,o=r"
owner: root
group: root
notify:
- Restart Varnish
# Apache
- name: "Ensure Apache2 default Enabled VHost is absent"
file:
state: absent
path: /etc/apache2/sites-enabled/000-default.conf
- name: "Ensure the log directories are present"
file:
path: "/var/log/apache2/{{ item }}"
state: directory
owner: root
group: adm
mode: "u=rwx,g=rx,o=rx"
loop:
- "zuv-intranet"
- "zuv-serviceportal"
- name: "Copy includes"
copy:
src: "files/{{ item }}"
dest: "/etc/apache2/includes/{{ item }}"
force: yes
owner: root
group: root
mode: "u=rw,g=r,o=r"
loop:
- blacklist_proxy.include
- fiona_intranet_blacklist.include
- fiona_serviceportal_blacklist.include
- plone_blacklist_rewrite.include
notify:
- "Reload Apache httpd"
- name: "Install vhost.confs for sites"
template:
src: templates/{{ item }}.j2
dest: /etc/apache2/sites-available/{{ item }}
force: yes
owner: root
group: root
mode: "u=rw,g=r,o=r"
loop:
- zuv-intranet.webproxy.verwaltung.uni-muenchen.de.conf
- zuv-serviceportal.webproxy.verwaltung.uni-muenchen.de.conf
notify:
- "Reload Apache httpd"
- name: "Activate vhost.confs (Create the link for site enabled specific configurations)"
file:
src: /etc/apache2/sites-available/{{ item }}
path: /etc/apache2/sites-enabled/{{ item }}
force: yes
state: link
owner: root
group: root
loop:
- zuv-intranet.webproxy.verwaltung.uni-muenchen.de.conf
- zuv-serviceportal.webproxy.verwaltung.uni-muenchen.de.conf
notify:
- "Reload Apache httpd"