ansible-roles/php/tasks/config_cli.yml
David Prevot fc692cf65b
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
Allow more --check runs
Use “when: not ansible_check_mode” or “when <file>.stat.exists or not
ansible_check_mode” in order to provide a meaningful diff if possible.

This is an improvement from the previously reverted commit
1728eaee68.
2022-12-21 18:05:41 +01:00

42 lines
1.1 KiB
YAML

---
- name: "Set default php.ini values for CLI"
ini_file:
dest: "{{ php_cli_defaults_ini_file }}"
section: PHP
option: "{{ item.option }}"
value: "{{ item.value }}"
mode: "0644"
create: yes
loop:
- { option: "display_errors", value: "On" }
- { option: "allow_url_fopen", value: "On" }
- { option: "disable_functions", value: "" }
- name: Custom php.ini for CLI
copy:
dest: "{{ php_cli_custom_ini_file }}"
content: |
; Put customized values here.
force: no
# This task is not merged with the above copy
# because "force: no" prevents any fix after the fact
- name: "Permissions for custom php.ini for CLI"
file:
dest: "{{ php_cli_custom_ini_file }}"
mode: "0644"
when: not ansible_check_mode
- name: "Set custom values for PHP to enable Symfony"
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" }
when:
- php_symfony_requirements | bool
- not ansible_check_mode