-
-
Notifications
You must be signed in to change notification settings - Fork 606
/
Copy pathmain.yml
42 lines (37 loc) · 1.19 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
---
- include: database.yml
tags: wordpress-setup-database
- include: self-signed-certificate.yml
tags: wordpress-setup-self-signed-certificate
- name: Create web root
file:
path: "{{ www_root }}"
owner: "{{ web_user }}"
group: "{{ web_group }}"
mode: 0755
state: directory
with_dict: "{{ wordpress_sites }}"
- name: Create logs folder of sites
file:
path: "{{ www_root }}/{{ item.key }}/logs"
owner: "{{ web_user }}"
group: "{{ web_group }}"
mode: 0755
state: directory
with_dict: "{{ wordpress_sites }}"
- name: Create WordPress php-fpm configuration file
template:
src: php-fpm.conf.j2
dest: /etc/php/7.0/fpm/pool.d/wordpress.conf
notify: reload php-fpm
- include: nginx.yml
tags: wordpress-setup-nginx
- name: Setup WP system cron
cron:
name: "{{ item.key }} WordPress cron"
minute: "*/15"
user: "{{ web_user }}"
job: "cd {{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }} && wp cron event run --due-now"
cron_file: "wordpress-{{ item.key | replace('.', '_') }}"
with_dict: "{{ wordpress_sites }}"
when: site_env.disable_wp_cron and not item.value.multisite.enabled | default(false)