mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
container cp needed the role checkout on the node running the docker CLI, which does not exist on swarm workers; the mu-plugins now stream through container exec -i tee with the file read controller-side. The daggerhart WP-CLI eval line was indented deeper than its folded scalar block, so YAML kept the newline and bash -lc received no script argument; realigning the indent folds it back into one command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
19 lines
1.2 KiB
YAML
19 lines
1.2 KiB
YAML
---
|
|
- name: "🖥️ WP OIDC: stack-host container ops"
|
|
when: IS_STACK_HOST | bool
|
|
block:
|
|
- name: "✅ Ensure the OIDC settings option exists as a PHP-serialized empty array"
|
|
ansible.builtin.shell: >
|
|
container exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER_ADDRESS }} bash -lc
|
|
"serialized_empty_array=$(wp eval 'echo serialize(array());' --path={{ WORDPRESS_DOCKER_HTML_PATH }}); \
|
|
wp option add openid_connect_generic_settings \"$serialized_empty_array\" --path={{ WORDPRESS_DOCKER_HTML_PATH }} \
|
|
|| wp option update openid_connect_generic_settings \"$serialized_empty_array\" --path={{ WORDPRESS_DOCKER_HTML_PATH }};"
|
|
|
|
- name: "📌 Apply all OIDC settings via WP-CLI eval (safe via base64)"
|
|
vars:
|
|
oidc_settings_json_b64: "{{ lookup('config', application_id, 'addons.daggerhart-openid-connect-generic.config.oidc_settings') | to_json | b64encode }}"
|
|
ansible.builtin.shell: >
|
|
container exec -u {{ WORDPRESS_USER }} {{ WORDPRESS_CONTAINER_ADDRESS }} bash -lc
|
|
"wp eval \"update_option('openid_connect_generic_settings', json_decode(base64_decode('{{ oidc_settings_json_b64 }}'), true));\" --path={{ WORDPRESS_DOCKER_HTML_PATH
|
|
}}"
|