2014-11-11 18:34:06 +01:00
|
|
|
---
|
|
|
|
- name: Ensure configuration directories exist.
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2015-04-14 20:29:26 +02:00
|
|
|
follow: true
|
2016-03-04 03:24:26 +01:00
|
|
|
with_flattened:
|
|
|
|
- "{{ php_conf_paths }}"
|
|
|
|
- "{{ php_extension_conf_paths }}"
|
2014-11-11 18:34:06 +01:00
|
|
|
|
|
|
|
- name: Place PHP configuration file in place.
|
|
|
|
template:
|
|
|
|
src: php.ini.j2
|
2016-03-04 03:24:26 +01:00
|
|
|
dest: "{{ item }}/php.ini"
|
2014-11-11 18:34:06 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2016-03-04 03:24:26 +01:00
|
|
|
with_items: "{{ php_conf_paths }}"
|
2014-11-11 18:34:06 +01:00
|
|
|
notify: restart webserver
|
|
|
|
when: php_use_managed_ini
|
|
|
|
|
2016-05-21 00:00:24 +02:00
|
|
|
- name: Check for PHP-installed APCu configuration file(s)
|
|
|
|
find:
|
|
|
|
paths: "{{ item }}"
|
|
|
|
contains: 'extension(\s+)?=(\s+)?apc[u]?\.so'
|
|
|
|
register: php_installed_apc_confs
|
|
|
|
with_items: "{{ php_extension_conf_paths }}"
|
|
|
|
|
|
|
|
- name: Remove any PHP-installed APCu configuration files in favor of role configuration
|
|
|
|
file:
|
|
|
|
path: "{{ item.1.path }}"
|
|
|
|
state: absent
|
|
|
|
when: php_apc_conf_filename != (item.1.path.split('/') | last)
|
|
|
|
with_subelements:
|
|
|
|
- "{{ php_installed_apc_confs.results }}"
|
|
|
|
- files
|
|
|
|
notify: restart webserver
|
|
|
|
|
2016-05-12 05:27:02 +02:00
|
|
|
- name: Place APCu configuration file in place.
|
2014-11-11 18:34:06 +01:00
|
|
|
template:
|
|
|
|
src: apc.ini.j2
|
2016-03-04 03:24:26 +01:00
|
|
|
dest: "{{ item }}/{{ php_apc_conf_filename }}"
|
2014-11-11 18:34:06 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
2015-02-26 21:17:51 +01:00
|
|
|
force: yes
|
2014-11-11 18:34:06 +01:00
|
|
|
mode: 0644
|
2016-03-04 03:24:26 +01:00
|
|
|
with_items: "{{ php_extension_conf_paths }}"
|
2014-11-11 18:34:06 +01:00
|
|
|
when: php_enable_apc
|
|
|
|
notify: restart webserver
|
|
|
|
|
2016-05-21 00:00:24 +02:00
|
|
|
- name: Check for PHP-installed OpCache configuration file(s)
|
|
|
|
find:
|
|
|
|
paths: "{{ item }}"
|
|
|
|
contains: 'zend_extension(\s+)?=(\s+)?opcache\.so'
|
|
|
|
register: php_installed_opcache_confs
|
|
|
|
with_items: "{{ php_extension_conf_paths }}"
|
|
|
|
|
|
|
|
- name: Remove any PHP-installed OpCache configuration files in favor of role configuration
|
|
|
|
file:
|
|
|
|
path: "{{ item.1.path }}"
|
|
|
|
state: absent
|
|
|
|
when: php_opcache_conf_filename != (item.1.path.split('/') | last)
|
|
|
|
with_subelements:
|
|
|
|
- "{{ php_installed_opcache_confs.results }}"
|
|
|
|
- files
|
|
|
|
notify: restart webserver
|
|
|
|
|
2015-04-30 22:54:15 +02:00
|
|
|
- name: Place OpCache configuration file in place.
|
|
|
|
template:
|
|
|
|
src: opcache.ini.j2
|
2016-03-04 03:24:26 +01:00
|
|
|
dest: "{{ item }}/{{ php_opcache_conf_filename }}"
|
2015-04-30 22:54:15 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
force: yes
|
|
|
|
mode: 0644
|
2016-03-04 03:24:26 +01:00
|
|
|
with_items: "{{ php_extension_conf_paths }}"
|
2015-04-30 22:54:15 +02:00
|
|
|
when: php_opcache_enable
|
|
|
|
notify: restart webserver
|