forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
youphptube.yaml
127 lines (108 loc) · 3.55 KB
/
youphptube.yaml
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
---
- hosts: jitsi #or name it how do you want
become: true
pre_tasks:
- name: Update apt cache
apt: update_cache=yes cache_valid_time=3600
handlers:
- name: restart apache
service: name=apache2 state=restarted
tasks:
- name: install some packages
apt: name={{ item }} state=present
with_items:
- software-properties-common
- dirmngr
- sudo
- python-mysqldb
- name: add key
command:
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
- name: add repo
apt_repository:
repo: deb [arch=amd64,i386,ppc64el] http://ftp.osuosl.org/pub/mariadb/repo/10.2/debian stretch main
state: present
- name: install mariadb
apt:
name: mariadb-server
state: present
- name: remove test database
mysql_db: db=test state=absent
- name: create aVideo database
mysql_db: db=aVideo state=present
- name: create user avideo
mysql_user:
name: avideo
password: passw0rd
priv: 'aVideo.*:ALL,GRANT'
host: localhost
state: present
- name: create aVideoEncoder database
mysql_db: db=aVideo-Encoder state=present
- name: create user aVideoEncoder
mysql_user:
name: avideoencoder
password: passw0rd
priv: 'aVideo-Encoder.*:ALL,GRANT'
host: localhost
state: present
- name: install packages
apt: name={{ item }} state=present
with_items:
- curl
- apache2
- php7.0
- libapache2-mod-php7.0
- php7.0-mysql
- php7.0-curl
- php7.0-gd
- php7.0-intl
- ffmpeg
- git
- libimage-exiftool-perl
- python
- name: get aVideo
git:
repo: https://github.com/WWBN/AVideo.git
dest: /var/www/html/AVideo
clone: yes
- name: get aVideoEncoder
git:
repo: https://github.com/WWBN/AVideo-Encoder.git
dest: /var/www/html/AVideo-Encoder
clone: yes
- name: get youtube-dl and set rights
command: "{{ item }}"
warn: False
with_items:
- curl -L https://youtube-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
- chmod a+rx /usr/local/bin/youtube-dl
- a2enmod rewrite
notify: restart apache
- name: create folder videos in aVideo
file:
path: /var/www/html/AVideo/videos
state: directory
owner: www-data
group: www-data
mode: 0755
- name: create folder videos in aVideoEncoder
file:
path: /var/www/html/AVideo-Encoder/videos
state: directory
owner: www-data
group: www-data
mode: 0755
- name: modify php.ini and apache2.conf
lineinfile:
dest: "{{ item.dest}}"
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
backrefs: yes
with_items:
- {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'post_max_size = 8M', line: 'post_max_size = 1000M'}
- {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'upload_max_filesize = 2M', line: 'upload_max_filesize = 1000M'}
- {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'max_execution_time = 30', line: 'max_execution_time = 7200'}
- {dest: '/etc/php/7.0/apache2/php.ini', regexp: 'memory_limit = 128M', line: 'memory_limit = 512M'}
- {dest: '/etc/apache2/apache2.conf', regexp: 'AllowOverride None', line: 'AllowOverride All', insertbefore='<Directory /srv/>' }
notify: restart apache