2016-01-15 03:47:25 +01:00
|
|
|
---
|
|
|
|
- name: Define php_fpm_daemon.
|
|
|
|
set_fact:
|
|
|
|
php_fpm_daemon: "{{ __php_fpm_daemon }}"
|
|
|
|
when: php_fpm_daemon is not defined
|
|
|
|
|
2016-01-22 11:00:30 +01:00
|
|
|
- name: Define php_fpm_pool_conf_path.
|
|
|
|
set_fact:
|
|
|
|
php_fpm_pool_conf_path: "{{ __php_fpm_pool_conf_path }}"
|
|
|
|
when: php_fpm_pool_conf_path is not defined
|
|
|
|
|
2016-05-19 16:07:12 +02:00
|
|
|
- name: Define php_fpm_pool_user.
|
|
|
|
set_fact:
|
|
|
|
php_fpm_pool_user: "{{ __php_fpm_pool_user }}"
|
|
|
|
when: php_fpm_pool_user is not defined
|
|
|
|
|
|
|
|
- name: Define php_fpm_pool_group.
|
|
|
|
set_fact:
|
|
|
|
php_fpm_pool_group: "{{ __php_fpm_pool_group }}"
|
|
|
|
when: php_fpm_pool_group is not defined
|
|
|
|
|
2016-04-12 03:27:47 +02:00
|
|
|
- name: Stat php_fpm_pool_conf_path
|
|
|
|
stat:
|
|
|
|
path: "{{ php_fpm_pool_conf_path | dirname }}"
|
2016-04-12 01:47:48 +02:00
|
|
|
register: php_fpm_pool_conf_path_dir_stat
|
|
|
|
|
2016-03-07 04:26:53 +01:00
|
|
|
- name: Ensure the default pool directory exists.
|
|
|
|
file:
|
|
|
|
path: "{{ php_fpm_pool_conf_path | dirname }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
2016-04-12 03:27:47 +02:00
|
|
|
when: php_fpm_pool_conf_path_dir_stat.stat.islnk is not defined
|
2016-03-07 04:26:53 +01:00
|
|
|
|
2020-06-05 11:30:15 +02:00
|
|
|
- name: Create fpm pools.
|
2016-05-19 16:07:12 +02:00
|
|
|
template:
|
2020-06-05 11:30:15 +02:00
|
|
|
src: "{{ item.pool_template | default('www.conf.j2', true) }}"
|
|
|
|
dest: "{{ php_fpm_pool_conf_path | dirname }}/{{ item.pool_name }}.conf"
|
2016-03-07 04:06:46 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2020-06-05 11:30:15 +02:00
|
|
|
force: true
|
|
|
|
loop: "{{ php_fpm_pools | default([], true) }}"
|
2016-01-15 03:47:25 +01:00
|
|
|
when: php_enable_php_fpm
|
|
|
|
notify: restart php-fpm
|
|
|
|
|
|
|
|
- name: Ensure php-fpm is started and enabled at boot (if configured).
|
2017-05-17 05:05:27 +02:00
|
|
|
service:
|
|
|
|
name: "{{ php_fpm_daemon }}"
|
2020-03-06 16:38:47 +01:00
|
|
|
state: "{{ php_fpm_state }}"
|
|
|
|
enabled: "{{ php_fpm_enabled_on_boot }}"
|
2017-05-17 05:05:27 +02:00
|
|
|
when: php_enable_php_fpm and ansible_distribution != "Debian"
|