-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.yml
93 lines (79 loc) · 2.36 KB
/
web.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
---
- hosts: server
remote_user: "{{ remote_user }}"
become: yes
roles:
- role: bertvv.mariadb
mariadb_root_password: "{{ db_root_password }}"
mariadb_databases:
- nextcloud
- wallabag
- piwik
mariadb_users:
- name: nextcloud_admin
password: "{{nextcloud_db_password}}"
priv: "nextcloud.*:ALL"
- name: wallabag
password: "{{wallabag_db_password}}"
priv: "wallabag.*:ALL"
- name: piwik
password: "{{piwik_db_password}}"
priv: "piwik.*:ALL"
- geerlingguy.repo-remi
tasks:
- yum: pkg=yum-utils state=present
- name: enable php70
command: yum-config-manager --enable remi-php70
changed_when: false
- name: Install web server programs
yum: pkg={{item}} state=present
with_items:
- nginx
- php-fpm
- php-xml
- php-gd
- php-mbstring
- php-mysql
- php-cli
- php-process
- php-pecl-zip
- php-pecl-apcu
- redis
- php-pecl-redis
- composer
- php-bcmath
- php-pecl-geoip
- name: Create nginx dhparam
command: openssl dhparam -out /etc/nginx/dhparam.pem 2048
args:
creates: /etc/nginx/dhparam.pem
- name: Install directories
file: path={{item}} owner=nginx state=directory
with_items:
- /var/run/php-fpm/
- /var/lib/php/session
- "{{data_mount}}/webapps"
- name: Install conf files
template: src={{item.src}} dest={{item.dest}}
with_items:
- { src: nginx.conf, dest: /etc/nginx/nginx.conf }
- { src: nextcloud.conf, dest: /etc/nginx/nextcloud.conf }
- { src: php-fpm-www.conf, dest: /etc/php-fpm.d/www.conf }
- { src: wallabag.conf, dest: /etc/nginx/wallabag.conf }
- { src: php.ini, dest: /etc/php.ini }
notify:
- reload nginx
- restart php-fpm
- service: name={{item}} state=started enabled=yes
with_items: [ nginx, php-fpm, redis ]
- name: Nextcloud update cron
cron:
user: nginx
minute: "*/4"
name: nextcloud-update
job: php -f {{data_mount}}/webapps/pilvi/cron.php
handlers:
- name: reload nginx
service: name=nginx state=reloaded
- name: restart php-fpm
service: name=php-fpm state=reloaded