Use EspoCRM's ConfigWriter API to patch the 'siteUrl' setting during updates.
This makes the process idempotent, avoids brittle regex replacements, and
ensures the running configuration stays in sync with the deployment domain.
https://chatgpt.com/share/689bb860-ba90-800f-adb5-4fa5a992b267
- New task 04_update_domain.yml updates home/siteurl only when needed
- DB-wide search-replace (old → new), GUID-safe, precise, tables-with-prefix
- Normalizes http→https, strips trailing slashes, then flushes cache/rewrites
- Guarded by is_multisite()==0; multisite untouched
- Wired into main.yml with auto target URL via domains|get_url
Fixes post-domain-change mixed/CSP issues due to hard-coded old URLs.
https://chatgpt.com/share/689bac2d-3610-800f-b6f0-41dc79d13a14
Fix a templating crash during docker-compose.yml rendering when a role sets database_type to an empty string or does not expose it (e.g., svc-prx-openresty). Previously _database_id resolved to 'svc-db-' and get_app_conf attempted to read 'docker.services..name', raising AppConfigKeyError: Application ID 'svc-db-' not found.
Changes:
- Introduce _dbtype = (database_type | d('') | trim) and build _database_id only if _dbtype is non-empty.
- Guard central DB lookups: use get_app_conf(..., strict=False, default='') and only when _dbtype is set.
- Default _database_consumer_entity_name to get_entity_name of database_application_id or fallback to application_id.
- Only resolve database_port when _dbtype is set; otherwise empty.
- Minor formatting fixes for env and URL strings.
Impact:
- Prevents failures in roles without a DB or with database_type=''.
- Keeps previous behavior intact for apps with a valid database_type (mariadb/postgres).
- Eliminates 'config_path: docker.services..name' errors while keeping compose templates stable.
https://chatgpt.com/share/689b9d11-6308-800f-b20c-2d9f18d832f1
- Patch local.config.php in one sed exec:
* hostname, database, username, password
* system.url via '#' delimiter to avoid URL slash escaping
* Single notify: docker compose up
- env.j2:
* FRIENDICA_URL now uses domains|get_url(application_id, WEB_PROTOCOL)
* Simplify FRIENDICA_DEBUGGING with |lower
* Normalize spacing for readability
- vars/main.yml:
* Minor cleanups (comment header, spacing)
* Consistent friendica_docker_ldap_config path construction
Why: fewer container execs ⇒ faster runs; idempotent key updates; consistent URL configuration across env and PHP config.
Risk: requires WEB_PROTOCOL and domains|get_url to be defined in inventory/vars as elsewhere in the project.
https://chatgpt.com/share/689b92af-b184-800f-9664-2450e00b29d6
- Moved MIG data build commands into a dedicated 02_build_data.yml task file.
- Added async execution (async: 3600, poll: 0) for non-blocking build.
- Introduced mig_wait_for_build variable to optionally wait for completion.
- Added debug message to inform how to disable waiting via build_data.wait_for=false for performance.
- Updated config to use nested build_data.enabled and build_data.wait_for structure.
- Adjusted variable lookups accordingly.
https://chatgpt.com/share/689b54d2-e3b0-800f-91df-939ebc5e12ef
This test scans roles/*/handlers/main.yml and fails if a handler's 'name' contains a Jinja variable ({{ ... }}).
Reason:
- Handler names must be static to ensure reliable 'notify' resolution.
- Dynamic names can break handler matching, cause undefined-variable errors, and produce unstable logs.
Recommendation:
- Keep handler names static and, if dynamic behavior is needed, use a static 'listen:' key.
https://chatgpt.com/share/689b37dc-e1e4-800f-bd56-00b43c7701f6
- Added register, until, retries, and delay to all PostgreSQL-related tasks
in 02_init.yml to handle transient 'tuple concurrently updated' and similar errors.
- Changed 'when: "{{ postgres_init }}"' to 'when: postgres_init | bool' in main.yml
for correct boolean evaluation.
- Switched 'role' to 'roles' in postgresql_privs tasks for forward compatibility.
- Added postgres_retry_retries and postgres_retry_delay defaults in vars/main.yml
to centralize retry configuration.
https://chatgpt.com/share/689b2360-a8a4-800f-9acb-6d88d6aa5cb7
This test scans all roles/*/meta/main.yml for meta dependencies that are
likely unnecessary and could be replaced with guarded include_role/import_role
calls to improve performance.
A dependency is flagged as unnecessary when:
- The consumer role does not use provider variables in defaults/vars/handlers
(no early variable requirement), and
- Any usage of provider variables or handler notifications in tasks occurs
only after an explicit include/import of the provider in the same file,
or there is no usage at all.
Purpose:
Helps reduce redundant parsing/execution of roles and improves Ansible
performance by converting heavy global dependencies into conditional,
guarded includes where possible.
https://chatgpt.com/share/689a59ee-52f4-800f-8349-4f477dc97c7c
This test scans all .yml/.yaml files under any tasks/ directory and flags cases where the same
'when' condition appears on more than 3 tasks in the same file. Excessive duplication of identical
conditions can harm Ansible performance because the condition is re-evaluated for every task.
The test suggests replacing repeated conditions with an include_tasks call or a block guarded
by the condition to evaluate it only once.
https://chatgpt.com/share/6899c605-6f40-800f-a954-ccb62f8bbcf1
Updated test_mode_reset.py to also validate roles that contain a reset
task file (*_reset.yml or reset.yml) even when no mode_reset keyword is
found. The test now:
- Detects roles with reset files but no include, and fails accordingly.
- Ignores commented include_tasks and when lines.
- Ensures exactly one non-commented include of the reset file exists.
- Requires that the include is guarded in the same task block by a
when containing mode_reset | bool (with optional extra conditions).
This prevents silent omissions of reset task integration.
https://chatgpt.com/share/6899b745-7150-800f-98f3-ca714486f5ba