Newer
Older
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
---
- name: "Import web_app role - EspoCRM"
import_role:
name: _web_app
- name: "template {{ rev_proxy }}_app.j2 {{ app_instance_id }}"
template:
src: "{{ rev_proxy }}_app.j2"
dest: "/etc/{{ rev_proxy }}/sites-available/{{ app_instance_id }}.conf"
when: app_wsgi == "no"
notify: reload {{ rev_proxy }} web_app
tags:
- espocrm_rev_proxy
- name: "cron monthly retrieving slaves backups"
cron:
name: "Cron EspoCRM"
hour: "23"
minute: "0"
job: "/usr/bin/php -f {{ app_instance_root }}/cron.php > /dev/null 2>&1"
user: "{{ app_user }}"
- name: check if {{ app_instance_root }} exists
stat:
path: "{{ app_instance_root }}"
register: "app_root_exist"
tags:
- espocrm_files_rights
- name: attribute correct rights on files
file:
state: directory
path: "{{ item.path }}"
mode: "{{ item.mode }}"
tags:
- espocrm_files_rights
when: "app_root_exist.stat.exists"
loop: "{{ files_rights_directory }}"
- name: "directory and permissions on {{ app_instance_root }}/bin/command"
file:
state: file
path: "{{ app_instance_root }}/bin/command"
mode: 0754
tags:
- espocrm_files_rights
when: app_root_exist.stat.exists
- name: check if file /etc/php/{{ php_version }}/fpm/pool.d/php-fpm-{{ app_user }}.conf exists before modifying configuration
stat:
path: "/etc/php/{{ php_version }}/fpm/pool.d/php-fpm-{{ app_user }}.conf"
register: "fpmconf_espo_exist"
tags:
- confphpfpm_espocrm
- name : "Delete {{ item.key }} line in /etc/php/{{ php_version }}/fpm/pool.d/php-fpm-{{ app_user }}.conf"
lineinfile:
path: "/etc/php/{{ php_version }}/fpm/pool.d/php-fpm-{{ app_user }}.conf"
regex: '^php_value[{{ item.key }}]'
state: absent
loop: "{{ php_params }}"
tags:
- confphpfpm_espocrm
when: fpmconf_espo_exist.stat.exists
- name: "Configure {{ item.key }}"
lineinfile:
line: "php_value[{{ item.key }}] = {{ item.val }}"
path: "/etc/php/{{ php_version }}/fpm/pool.d/php-fpm-{{ app_user }}.conf"
state: present
loop: "{{ php_params }}"
tags:
- confphpfpm_espocrm
when: fpmconf_espo_exist.stat.exists
- name: Print db informations for manual installation
vars:
msg: |
db_name: {{ app_instance_id }}_db
db_user: {{ app_instance_id }}_usr
db_pass: {{ database_password }}
debug:
msg: "{{ msg.split('\n') }}"
tags: debug_db_info
when: app_run in ['install', 'reinstall']