-
Notifications
You must be signed in to change notification settings - Fork 0
/
lakof.yml
173 lines (153 loc) · 4.28 KB
/
lakof.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
---
- hosts: lakof
become: true
roles:
- lmu.ansible_role.base-preseed
- { role: maintenance,
maintenance: {
upgrade_type: "full",
allow_reboot: false
}
}
- plone-base
- supervisor
- hosts: lakof
become: true
handlers:
- include: roles/supervisor/handlers/main.yml
roles:
- { role: zc.buildout,
buildout: {
program_path: /opt/Plone,
data_path: /srv/Plone,
directory: buildout.lakof,
src: {
type: git,
src: "https://github.com/lmu/lakof.git",
rev: master,
},
config: local_production.cfg,
python: python3,
buildout_user: plone_buildout,
requires_secrets: true,
secrets: 'templates/secrets.cfg.j2',
login: 'admin',
password: 'admin',
mode: '',
}}
tasks:
- name: "Copy Supervisor Config"
copy:
src: supervisord_lakof.conf
dest: /etc/supervisor/conf.d/lakof.conf
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
pre_tasks:
- name: "Stop Supervisor"
service:
name: supervisor
state: stopped
enabled: yes
tags:
- plone_setup
- plone_upgrade
post_tasks:
- name: "Ensure buildout-directory/disable file exsits and is owned by plone_daemon"
file:
path: "/opt/Plone/buildout.lakof/disable"
state: touch
owner: plone_daemon
group: plone_group
mode: "u=rwx,g=rwx,o=rx"
- name: "Ensure buildout-data-directory is owned by user plone_daemon"
file:
path: "/srv/Plone/"
state: directory
owner: plone_daemon
group: plone_group
mode: "u=rwx,g=rwx,o=rx"
recurse: yes
- name: "Start Supervisor"
service:
name: supervisor
state: started
enabled: yes
tags:
- plone_setup
- plone_upgrade
- hosts: lakof
become: true
roles:
#- varnish
- apache_httpd
handlers:
- include: roles/apache_httpd/handlers/main.yml
tasks:
# 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:
- lakof
- name: "Copy includes"
copy:
src: "files/{{ item }}"
dest: "/etc/apache2/includes/{{ item }}"
force: yes
mode: "u=rw,g=r,o=r"
owner: root
group: root
loop:
- blacklist_proxy.include
- plone_blacklist_rewrite.include
notify:
- "Reload Apache httpd"
# - name: "Copy certificate"
# copy:
# src: "files/server-ssl/{{ item.src_dir }}/{{ item.src_name }}"
# dest: "/etc/ssl/{{ item.dest_dir }}/{{ item.dest_name }}"
# force: yes
# mode: "u=rw,g=r,o="
# owner: root
# group: root
# loop:
# - { src_name: "www.lakof-bayern.de_key.pem", dest_name: "www.lakof-bayern.de_key.pem", src_dir: "key", dest_dir: "private" }
# - { src_name: "www.lakof-bayern.de_signed_2021-12-10_crt.pem", dest_name: "www.lakof-bayern.de_signed_crt.pem", src_dir: "crt", dest_dir: "private" }
# - { src_name: "dfn-chain.crt", dest_name: "dfn-chain.crt", src_dir: "certs", dest_dir: "certs" }
# 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:
- lakof.conf
- lakof_ssl.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:
- lakof.conf
- lakof_ssl.conf
notify:
- "Reload Apache httpd"