-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
119 lines (116 loc) · 2.77 KB
/
playbook.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
- hosts: basilplayer
become: yes
tasks:
- name: Create basil user
user:
name: basil
groups: docker
- name: Install git
apt:
name: git
- name: Install docker
apt:
name: docker-ce
- name: Checkout sc-docker
become_user: basil
git:
repo: "https://github.com/basil-ladder/sc-docker.git"
dest: /home/basil/sc-docker
- name: Install scbw.play
become_user: basil
pip:
name: "file:///home/basil/sc-docker"
executable: /usr/bin/pip3
- name: Setup scbw.play
become_user: basil
command: scbw.play --install
args:
creates: /home/basil/.scbw
- name: Checkout basil
become_user: basil
git:
repo: "https://github.com/basil-ladder/basil.git"
dest: /home/basil/main
- hosts: basilstreamer
become: yes
tasks:
- name: Install ffmpeg
apt:
name: ffmpeg
- name: Install xvfb
apt:
name: xvfb
state: present
- name: Install chromium
apt:
name: chromium-browser
- name: Create basil user
user:
name: basil
- hosts: basilfilehoster
become: yes
vars_files:
- vars/default.yml
tasks:
- name: Create basil user
user:
name: basil
- name: Deplay basil public key
authorized_key:
user: basil
state: present
key: "{{ lookup('file', 'files/public-ssh-key') }}"
- name: Install apache
apt:
name: apache2
- name: Create basil document root
file:
path: /etc/apache2/include
state: directory
owner: basil
mode: 0775
- name: Support precompressed files in apache2
copy:
src: files/pre-compressed.conf
dest: /etc/apache2/include/pre-compressed.conf
owner: root
group: root
mode: 0644
- name: Copy basil conf
template:
src: files/basil.conf
dest: /etc/apache2/sites-available/basil.conf
owner: root
group: root
mode: 0644
- name: Enable precompressed files module
apache2_module:
name: headers
- name: Enable precompressed files module
apache2_module:
name: rewrite
- name: Disable default site
shell: /usr/sbin/a2dissite 000-default.conf
notify: Reload Apache
- name: Disable default ssl site
shell: /usr/sbin/a2dissite 000-default-le-ssl.conf
notify: Reload Apache
- name: Create basil document root
file:
path: /var/www/basil
state: directory
owner: basil
mode: 0775
- name: Copy robots file
copy:
src: files/robots.txt
dest: /var/www/basil/robots.txt
mode: 0644
- name: Enable Basil site
shell: /usr/sbin/a2ensite basil.conf
notify: Reload Apache
handlers:
- name: Reload Apache
service:
name: apache2
state: reloaded