Ludovic Poujol
e71cffd8fd
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2624|6|2618|10|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/329//ansiblelint">Evolix » ansible-roles » unstable #329</a>
gitea/ansible-roles/pipeline/head This commit looks good
92 lines
3 KiB
YAML
92 lines
3 KiB
YAML
---
|
|
|
|
- name: Set default php.ini values for FPM
|
|
community.general.ini_file:
|
|
dest: "{{ php_fpm_defaults_ini_file }}"
|
|
section: PHP
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
mode: "0644"
|
|
create: yes
|
|
loop:
|
|
- { option: "short_open_tag", value: "Off" }
|
|
- { option: "expose_php", value: "Off" }
|
|
- { option: "display_errors", value: "Off" }
|
|
- { option: "log_errors", value: "On" }
|
|
- { option: "html_errors", value: "Off" }
|
|
- { option: "allow_url_fopen", value: "Off" }
|
|
- { option: "opcache.memory_consumption", value: "128M" }
|
|
- { option: "opcache.max_accelerated_files", value: "8000" }
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
|
|
- name: Disable PHP functions for FPM
|
|
community.general.ini_file:
|
|
dest: "{{ php_fpm_defaults_ini_file }}"
|
|
section: PHP
|
|
option: disable_functions
|
|
value: "exec,shell-exec,system,passthru,popen"
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
|
|
- name: Custom php.ini for FPM
|
|
ansible.builtin.copy:
|
|
dest: "{{ php_fpm_custom_ini_file }}"
|
|
content: |
|
|
; Put customized values here.
|
|
force: false
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
|
|
- name: Set default pool (www) config values
|
|
community.general.ini_file:
|
|
dest: "{{ php_fpm_default_pool_file }}"
|
|
section: www
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
mode: "0644"
|
|
create: yes
|
|
loop:
|
|
- { option: "user", value: "www-data" }
|
|
- { option: "group", value: "www-data" }
|
|
- { option: "listen", value: "{{ php_fpm_default_pool_socket }}" }
|
|
- { option: "listen.owner", value: "www-data" }
|
|
- { option: "listen.group", value: "www-data" }
|
|
- { option: "pm", value: "ondemand" }
|
|
- { option: "pm.max_children", value: "100" }
|
|
- { option: "pm.process_idle_timeout", value: "10s" }
|
|
- { option: "slowlog", value: "/var/log/$pool.log.slow" }
|
|
- { option: "request_slowlog_timeout", value: "5s" }
|
|
- { option: "pm.status_path", value: "/fpm_status" }
|
|
- { option: "request_terminate_timeout", value: "60s" }
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
when:
|
|
- ansible_distribution_major_version is version('9', '>=')
|
|
- php_fpm_override_default_pool
|
|
|
|
- name: Custom PHP FPM values
|
|
ansible.builtin.copy:
|
|
dest: "{{ php_fpm_default_pool_custom_file }}"
|
|
content: |
|
|
; Put customized values here.
|
|
; default_charset = "ISO-8859-1"
|
|
mode: "0644"
|
|
force: false
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
|
|
- name: "Set custom values for PHP to enable Symfony"
|
|
community.general.ini_file:
|
|
dest: "{{ php_cli_custom_ini_file }}"
|
|
section: PHP
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
mode: "0644"
|
|
loop:
|
|
- { option: "date.timezone", value: "Europe/Paris" }
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
when: php_symfony_requirements | bool
|
|
|
|
- name: Delete debian default pool
|
|
ansible.builtin.file:
|
|
path: "{{ php_fpm_debian_default_pool_file | mandatory }}"
|
|
state: absent
|
|
notify: "restart {{ php_fpm_service_name }}"
|
|
when: php_fpm_remove_default_pool | bool
|