blob: 50a2585a34058fd14593718d06c7d6e2fc546d1d (
plain)
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
|
---
- name: Install ikiwiki package and dependencies
apt: name={{ item }} state=present
with_items:
- ikiwiki
- perlmagick
- libmagickcore-extra
notify: Rebuild ikiwiki
- name: Place vhost config
template:
dest=/etc/apache2/sites-enabled/000-default_subweb.conf
src=vhost.conf.j2
notify: Reload apache
- name: Create config snippet dir
file:
name=/etc/apache2/sites/{{ sublab_web_server_name }}
recurse=yes
state=directory
- name: Place config snippets
template:
dest=/etc/apache2/sites/{{ sublab_web_server_name }}/{{ item }}
src={{ item }}.j2
with_items:
- server.conf
- ssl.conf
- subdap-plain.conf
- subdap-ssl.conf
- wiki.conf
notify: Reload apache
- name: Create SSL DIR
file:
path=/etc/apache2/sites/{{ sublab_web_server_name }}/ssl
state=directory
- name: Place SSL cert and chain
copy:
src=ssl/{{ sublab_web_server_name }}/{{item}}
dest=/etc/apache2/sites/{{ sublab_web_server_name }}/ssl/{{item}}
with_items:
- cert.pem
- chain.pem
notify: Reload apache
- name: Place SSL key
copy:
content="{{ssl_keys[sublab_web_server_name]}}"
dest="/etc/apache2/sites/{{sublab_web_server_name}}/ssl/key.pem"
mode=0600
notify: Reload apache
- name: Create Website group
group: name=sublab_web
- name: Create Website user
user:
name=sublab_web
group=sublab_web
home="/var/www/{{sublab_web_server_name}}"
- name: Create Wiki group
group: name=sublab_wiki
- name: Create Wiki user
user:
name=sublab_wiki
group=sublab_wiki
home="/home/wiki-{{sublab_web_server_name}}"
- include: as_webuser.yaml
become: yes
become_method: su
become_user: sublab_web
- include: as_wikiuser.yaml
become: yes
become_method: su
become_user: sublab_wiki
|