mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
fix(wordpress): ship mu-plugins via exec stdin and unbreak OIDC eval fold
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>
This commit is contained in:
1 parent
15a8d26ea4
commit
03ed52eea5
2 files changed
+11
-8
No files matched your search
@@ -11,9 +11,11 @@
|
||||
|
||||
- name: "📋 Copy infinito-oidc-rbac-mapper.php into the container"
|
||||
shell: >
|
||||
container cp
|
||||
{{ [role_path, 'files/mu-plugins/infinito-oidc-rbac-mapper.php'] | path_join }}
|
||||
{{ WORDPRESS_CONTAINER_ADDRESS }}:{{ WORDPRESS_DOCKER_HTML_PATH }}/wp-content/mu-plugins/infinito-oidc-rbac-mapper.php
|
||||
container exec -i {{ WORDPRESS_CONTAINER_ADDRESS }}
|
||||
tee {{ WORDPRESS_DOCKER_HTML_PATH }}/wp-content/mu-plugins/infinito-oidc-rbac-mapper.php
|
||||
> /dev/null
|
||||
args:
|
||||
stdin: "{{ lookup('file', [role_path, 'files/mu-plugins/infinito-oidc-rbac-mapper.php'] | path_join) }}"
|
||||
register: cp_mu_plugin
|
||||
changed_when: cp_mu_plugin.rc == 0
|
||||
failed_when: cp_mu_plugin.rc != 0
|
||||
@@ -27,9 +29,11 @@
|
||||
|
||||
- name: "📋 Copy infinito-http-ca-trust.php into the container"
|
||||
shell: >
|
||||
container cp
|
||||
{{ [role_path, 'files/mu-plugins/infinito-http-ca-trust.php'] | path_join }}
|
||||
{{ WORDPRESS_CONTAINER_ADDRESS }}:{{ WORDPRESS_DOCKER_HTML_PATH }}/wp-content/mu-plugins/infinito-http-ca-trust.php
|
||||
container exec -i {{ WORDPRESS_CONTAINER_ADDRESS }}
|
||||
tee {{ WORDPRESS_DOCKER_HTML_PATH }}/wp-content/mu-plugins/infinito-http-ca-trust.php
|
||||
> /dev/null
|
||||
args:
|
||||
stdin: "{{ lookup('file', [role_path, 'files/mu-plugins/infinito-http-ca-trust.php'] | path_join) }}"
|
||||
register: cp_ca_trust_mu_plugin
|
||||
changed_when: cp_ca_trust_mu_plugin.rc == 0
|
||||
failed_when: cp_ca_trust_mu_plugin.rc != 0
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
|| 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)"
|
||||
# base64-encoded JSON to avoid shell-escape issues in the eval payload.
|
||||
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
|
||||
"wp eval \"update_option('openid_connect_generic_settings', json_decode(base64_decode('{{ oidc_settings_json_b64 }}'), true));\" --path={{ WORDPRESS_DOCKER_HTML_PATH
|
||||
}}"
|
||||
Reference in new issue
Block a user