-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.yml
161 lines (142 loc) · 3.35 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
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
# Defaults tasks for role moin
- name: Ensuring moin is installed
yum:
name: ['moin', 'mod_wsgi']
state: latest
- name: Configuring httpd
import_role:
name: httpd
vars:
httpd_tls: "{{ moin_httpd_tls }}"
- name: Configuring httpd vhost
template:
src: 02_moin_vhost.conf.j2
dest: /etc/httpd/conf.d/02_moin_vhost.conf
mode: 0644
notify:
- restart_httpd
- name: Configuring https
template:
src: "{{ item }}.j2"
dest: "/etc/httpd/conf.d/{{ item }}"
mode: 0644
notify:
- restart_httpd
with_items:
- ssl-moin-vhost.conf
when: moin_httpd_tls
- name: Ensuring we have local directories for httpd moin
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ moin_httpd_dir }}"
- import_role:
name: httpd
tasks_from: pki-tls
vars:
pki_hostname: "{{ moin_httpd_hostname }}"
notify:
- restart_httpd
tags:
- tls
when: moin_httpd_tls
- name: wrapper to init a moin instance
template:
src: init_moin_instance.j2
dest: /usr/share/moin/init_moin_instance
mode: 0750
tags:
- config
- name: Ensuring we have local directories for moin
file:
path: "{{ item }}"
state: directory
owner: apache
group: apache
setype: httpd_sys_rw_content_t
with_items:
- "{{ moin_instance_dir }}"
- "{{ moin_instance_dir }}/data"
- "{{ moin_instance_dir }}/underlay"
register: moin_instance_init
tags:
- config
- name: Calling init if needed
command: /usr/share/moin/init_moin_instance
when: moin_instance_init is changed
tags:
- config
- name: Configuring moin instance with wikiconfig.py
template:
src: wikiconfig.py.j2
dest: "{{ moin_instance_dir }}/wikiconfig.py"
mode: 0644
tags:
- config
- name: Configuring wsgi
template:
src: moin.wsgi.j2
dest: "{{ moin_instance_dir }}/moin.wsgi"
mode: 0644
tags:
- config
- name: Importing theme {{ moin_theme }}
synchronize:
src: "themes/{{ moin_theme }}/"
dest: "/usr/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/{{ moin_theme }}/"
tags:
- theme
- config
- name: Importing plugin theme
copy:
src: "plugin/theme/{{ moin_theme }}.py"
dest: "{{ moin_instance_dir }}/data/plugin/theme/{{ moin_theme }}.py"
tags:
- theme
- config
- name: Importing site logo
copy:
src: "logos/{{ moin_sitelogo }}"
dest: "/usr/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/common/"
tags:
- theme
- config
- name: Importing favicon.ico
copy:
src: "logos/favicon.ico"
dest: "/usr/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/"
tags:
- theme
- config
- name: Configuring robots.txt
template:
src: robots.txt.j2
dest: "/usr/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/robots.txt"
tags:
- config
- name: Importing moin plugin[s]
copy:
src: "plugin/{{ item }}"
dest: "{{ moin_instance_dir }}/data/plugin/{{ item }}"
with_items: "{{ moin_plugins }}"
tags:
- plugins
- config
- include_tasks: selinux.yml
tags:
- selinux
- include_role:
name: postfix
tasks_from: relay_to
vars:
postfix_relay_to: True
when: moin_send_mail
- name: Ensuring backup user and jobs
include_role:
name: centos-backup
tasks_from: client
vars:
- centos_role: moin
- role_backup_folders:
- "{{ moin_instance_dir }}"