mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-02 15:39:57 +00:00
Add dynamic PHP error handling config for SuiteCRM:
- Introduce env-aware php.ini.j2 template - Mount PHP config into container via docker-compose - Add SUITECRM_PHP_CONFIG_HOST and SUITECRM_WELL_SOFTWARE_NAME variables - Refactor LDAP extension path using normalized software name https://chatgpt.com/share/69284194-cf6c-800f-b138-eb6ddf25592c
This commit is contained in:
@@ -4,6 +4,13 @@
|
||||
vars:
|
||||
docker_compose_flush_handlers: false
|
||||
|
||||
- name: "Deploy PHP error configuration (env aware)"
|
||||
template:
|
||||
src: "php.ini.j2"
|
||||
dest: "{{ SUITECRM_PHP_CONFIG_HOST }}"
|
||||
notify:
|
||||
- docker compose up
|
||||
|
||||
- name: "Render SuiteCRM LDAP mapping"
|
||||
template:
|
||||
src: ldap.yaml.j2
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
||||
volumes:
|
||||
- data:/var/www/html/
|
||||
- "{{ SUITECRM_PHP_CONFIG_HOST }}:/usr/local/etc/php/conf.d/{{ SUITECRM_WELL_SOFTWARE_NAME }}.ini:ro"
|
||||
|
||||
{% if SUITECRM_LDAP_ENABLED | bool %}
|
||||
# Readonly isn't possible for LDAP config, because otherwise file permission script will fail
|
||||
|
||||
14
roles/web-app-suitecrm/templates/php.ini.j2
Normal file
14
roles/web-app-suitecrm/templates/php.ini.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
; Dynamic error reporting based on ENVIRONMENT
|
||||
; Rendered by Ansible/Jinja2 at deploy time.
|
||||
|
||||
{% if (ENVIRONMENT | lower) == 'development' %}
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
log_errors = On
|
||||
error_reporting = E_ALL
|
||||
{% else %}
|
||||
display_errors = Off
|
||||
display_startup_errors = Off
|
||||
log_errors = On
|
||||
error_reporting = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED
|
||||
{% endif %}
|
||||
@@ -9,6 +9,10 @@ database_type: "mariadb"
|
||||
# Webserver
|
||||
client_max_body_size: "100m"
|
||||
|
||||
# General
|
||||
SUITECRM_WELL_SOFTWARE_NAME: "{{ SOFTWARE_NAME | lower | replace('.', '-') }}"
|
||||
SUITECRM_PHP_CONFIG_HOST: "{{ [ docker_compose.directories.config, 'php.ini'] | path_join }}"
|
||||
|
||||
# Container images
|
||||
# Base PHP image used to run SuiteCRM
|
||||
SUITECRM_BASE_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.' ~ entity_name ~ '.image') }}"
|
||||
@@ -29,7 +33,7 @@ SUITECRM_URL: "{{ domains | get_url(application_id, WEB_
|
||||
# LDAP
|
||||
SUITECRM_LDAP_ENABLED: "{{ applications | get_app_conf(application_id, 'features.ldap') }}"
|
||||
SUITECRM_LDAP_CONFIG_HOST: "{{ [ docker_compose.directories.config, 'ldap.yaml'] | path_join }}"
|
||||
SUITECRM_LDAP_EXTENSION_DIR: "/var/www/html/extensions/{{ SOFTWARE_NAME | lower | replace('.', '-') }}/config/services/ldap"
|
||||
SUITECRM_LDAP_EXTENSION_DIR: "{{ ['/var/www/html/extensions', SUITECRM_WELL_SOFTWARE_NAME, 'config/services/ldap'] | path_join }}"
|
||||
|
||||
# Simple maintenance toggle (for later extensions)
|
||||
SUITECRM_INIT_MAINTENANCE_MODE: "{{ applications | get_app_conf(application_id, 'maintenance_mode') }}"
|
||||
|
||||
Reference in New Issue
Block a user