7 Commits

Author SHA1 Message Date
Emilien Mantel
3209f6b010 Quickfix 2020-05-27 13:06:19 +02:00
Emilien Mantel
759a85a325 Fix FPM ini file 2020-05-27 12:59:25 +02:00
Emilien Mantel
704ebb3937 Manage pm.max_requests on PHP pool 2020-05-27 10:15:42 +02:00
Emilien Mantel
4feb3be7d5 Upgrade README.php 2019-12-26 18:10:56 +01:00
Emilien Mantel
c0922f8430 Option: autoremove default pool 2019-12-26 16:42:16 +01:00
Emilien Mantel
ade8aaad9e Remove useless files 2019-12-26 15:38:54 +01:00
Emilien M
a19adf5150 Improvements (#13)
- Store configuration in local facts
- Better socket generator
- php_admin_value/php_value
- Manages PHP 7.4 on Debian
2019-12-26 14:13:00 +01:00
7 changed files with 8 additions and 6 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@
*.retry
*.log
/filter_plugins/*.pyc
/filter_plugins/__pycache__

View File

@@ -29,7 +29,7 @@ FreeBSD limitations
-------------------
- It doesn't split ini file for FPM/CLI. It's hardcoded as `/usr/local/etc/php.ini`.
- It can't manage multiple PHP versions at the time (like old Debian versions)
- It can't manage multiple PHP versions at the time (like legacy Debian versions)
- You must explicitely set xdebug package name (use `pkg search xdebug` to find the good one)
Role Variables
@@ -39,7 +39,7 @@ You should look at [default vars](defaults/main.yml).
### Writable vars
- `php_version`: 7.0, 7.1, 7.2, 7.3
- `php_version`: 7.3, 7.4... depending OS (see above)
- `php_install_fpm`: boolean, install and manage php-fpm (default is true)
- `php_install_xdebug`: boolean, install [Xdebug](http://xdebug.org)
- `php_extra_packages`: additional php packages to install (default is an empty list).
@@ -56,7 +56,6 @@ Note:
- Put specific configuration in `php_ini_fpm`/`php_ini_cli`.
- You can override with `php_ini_fpm`/`php_ini_cli`, but it breaks idempotence.
#### OpCache settings
See [Opcache doc](https://secure.php.net/manual/en/opcache.configuration.php)

View File

@@ -5,6 +5,7 @@ php_install_fpm: true
php_install_xdebug: false
php_extra_packages: []
php_xdebug_package: null
php_autoremove_default_pool: false
# php.ini config
php_ini:

View File

@@ -14,7 +14,7 @@
- name: LINEINFILE | PHP configuration
lineinfile:
dest: '{{ php_cli_ini }}'
dest: '{{ php_fpm_ini }}'
regexp: '^;?{{ item.key }}'
line: '{{ item.key }} = {{ item.value }}'
create: yes
@@ -32,5 +32,5 @@
file:
path: "{{ php_fpm_pool_dir }}/www.conf"
state: absent
when: '"www" not in (ansible_local.hanxhx_php.fpm_pool | map(attribute="name") | list)'
when: '"www" not in (ansible_local.hanxhx_php.fpm_pool | map(attribute="name") | list) and php_autoremove_default_pool'
notify: restart php-fpm

View File

@@ -132,7 +132,7 @@ pm.process_idle_timeout = {{ item.pm_process_idle_timeout | default('10s') }};
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
pm.max_requests = {{ item.pm_max_requests | default('0') }}
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:

View File

@@ -6,6 +6,7 @@
php_extra_packages:
- '{{ php_package_prefix }}pgsql'
php_install_xdebug: true
php_autoremove_default_pool: true
php_ini_fpm:
display_errors: 'Off'
php_ini_cli: