mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-11-06 13:17:58 +00:00
feat(web-app-drupal): add Drupal role, OIDC config, and wiring
- networks: add web-app-drupal subnet 192.168.104.80/28 - ports: map localhost http port 8060 - add role files: tasks, vars, schema, users, templates (Dockerfile, docker-compose, settings.local.php, upload.ini) - add docs: README.md and Administration.md Ref: https://chatgpt.com/share/690535c5-b55c-800f-8556-5335a6b8a33f
This commit is contained in:
19
roles/web-app-drupal/tasks/05_trusted_hosts.yml
Normal file
19
roles/web-app-drupal/tasks/05_trusted_hosts.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- name: "Set trusted_host_patterns for canonical domains"
|
||||
vars:
|
||||
patterns: "{{ DRUPAL_DOMAINS
|
||||
| map('regex_replace','\\\\.','\\\\\\\\.')
|
||||
| map('regex_replace','^','^')
|
||||
| map('regex_replace','$','$')
|
||||
| list }}"
|
||||
php_array: "{{ patterns | to_json }}"
|
||||
command: >
|
||||
docker exec -u root {{ DRUPAL_CONTAINER }} bash -lc
|
||||
"php -r '
|
||||
$f="{{ DRUPAL_DOCKER_CONF_PATH }}/settings.local.php";
|
||||
$c=file_exists($f)?file_get_contents($f):"<?php\n";
|
||||
// Remove existing assignment of $settings[\"trusted_host_patterns\"] (if any)
|
||||
$c=preg_replace(\"/(\\\\$settings\\['trusted_host_patterns'\\]\\s*=).*?;/s\", \"\", $c);
|
||||
$c.="\n\$settings[\'trusted_host_patterns\'] = ".var_export(json_decode("{{ php_array|e }}", true), true).";\n";
|
||||
file_put_contents($f,$c);
|
||||
'"
|
||||
changed_when: true
|
||||
Reference in New Issue
Block a user