Files
computer-playbook/roles/web-app-openbao/vars/main.yml
kevinveenbirkenbachandClaude Opus 5.5 c925150848 fix(web-app-openbao): ship the LDAP auth method as an external plugin
OpenBao 2.7 removed the builtin LDAP auth engine from the server binary
(openbao/openbao GH-3882). `bao auth enable ldap` answered
"plugin not found in the catalog: ldap" and the deploy stopped there.

The role now builds its own image. A multi-stage Dockerfile copies the
openbao-plugin-auth-ldap binary out of the image declared as the
`auth-ldap` service entry into /opt/openbao/plugins. A second server
config file, plugins.hcl, names that directory and registers the plugin
declaratively. It sets plugin_auto_register = true explicitly: the image
starts the server with a config directory, and on that path 2.7.1 does
not apply the documented default, so without the line the catalog stays
empty. The Dockerfile sets the file mode in a helper stage instead of
COPY --chmod, which only BuildKit accepts.

The mount is enabled with -plugin-version=latest, so it follows whichever
plugin version the image ships. A mount created by the former builtin
engine is tuned and reloaded onto the plugin, which needs `update` on
sys/plugins/reload/backend in the ansible-admin policy.

The LDAP tasks move into tasks/addons/auth-ldap.yml and the plugin is
declared under meta/addons as a required addon bridged to `ldap`. Its
Playwright spec logs in through the mount and asserts that sys/auth
reports an external running plugin version.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-04 13:25:17 +02:00

77 lines
4.0 KiB
YAML

---
application_id: "web-app-openbao"
container_port: "{{ lookup('config', application_id, 'services.openbao.ports.internal.http') }}"
OPENBAO_NAME: "{{ lookup('config', application_id, 'services.openbao.name') }}"
OPENBAO_IMAGE: "{{ lookup('config', application_id, 'services.openbao.image') }}"
OPENBAO_VERSION: "{{ lookup('config', application_id, 'services.openbao.version') }}"
OPENBAO_LDAP_PLUGIN_IMAGE: "{{ lookup('config', application_id, 'services.auth-ldap.image') }}"
OPENBAO_LDAP_PLUGIN_VERSION: "{{ lookup('config', application_id, 'services.auth-ldap.version') }}"
OPENBAO_LDAP_PLUGIN_BINARY: "openbao-plugin-auth-ldap"
OPENBAO_PLUGIN_DIR_DOCKER: "/opt/openbao/plugins"
OPENBAO_IMAGE_TAG: "{{ OPENBAO_VERSION }}-auth-ldap-{{ OPENBAO_LDAP_PLUGIN_VERSION }}"
OPENBAO_SSO_ENABLED: "{{ lookup('config', application_id, 'services.sso.enabled') }}"
OPENBAO_LDAP_ENABLED: "{{ lookup('config', application_id, 'services.ldap.enabled') }}"
OPENBAO_PKI_ENABLED: "{{ lookup('config', application_id, 'services.openbao.pki.enabled') }}"
OPENBAO_LOG_LEVEL: "{{ lookup('config', application_id, 'services.openbao.log_level') }}"
OPENBAO_BASE_URL: "{{ lookup('tls', application_id, 'url.base') | regex_replace('/+$', '') }}"
OPENBAO_CONFIG_HOST: "{{ [lookup('container', application_id, 'directories.config'), 'openbao.hcl'] | path_join }}"
OPENBAO_PLUGINS_CONFIG_HOST: "{{ [lookup('container', application_id, 'directories.config'), 'plugins.hcl'] | path_join }}"
OPENBAO_POLICY_DIR_HOST: "{{ [lookup('container', application_id, 'directories.config'), 'policies'] | path_join }}"
OPENBAO_POLICY_DIR_DOCKER: "/openbao/policies"
OPENBAO_DATA_DOCKER: "{{ lookup('volume', application_id, 'data').target }}"
OPENBAO_SEAL_KEY: "{{ lookup('config', application_id, 'secrets.credentials.seal_key') }}"
OPENBAO_APPROLE_ROLE_ID: "{{ lookup('config', application_id, 'secrets.credentials.approle_role_id') }}"
OPENBAO_APPROLE_SECRET_ID: "{{ lookup('config', application_id, 'secrets.credentials.approle_secret_id') }}"
OPENBAO_SEAL_KEY_ID: "{{ (OPENBAO_SEAL_KEY | hash('sha256'))[:16] }}"
OPENBAO_APPLIED_STATE_HOST: "{{ [lookup('container', application_id, 'directories.instance'), '.applied.json'] | path_join }}"
OPENBAO_APPLIED: "{{ openbao_applied_state | default({}, true) }}"
OPENBAO_SEAL_KEY_PREVIOUS: "{{ OPENBAO_APPLIED.seal_key | default('', true) }}"
OPENBAO_SEAL_KEY_PREVIOUS_ID: "{{ (OPENBAO_SEAL_KEY_PREVIOUS | hash('sha256'))[:16] if OPENBAO_SEAL_KEY_PREVIOUS else '' }}"
OPENBAO_SEAL_ROTATING: "{{ (OPENBAO_SEAL_KEY_PREVIOUS | length > 0) and (OPENBAO_SEAL_KEY_PREVIOUS != OPENBAO_SEAL_KEY) }}"
OPENBAO_RECOVERY_USER_KEY: "administrator"
OPENBAO_RECOVERY_TOKEN_APP: "{{ application_id }}-recovery"
OPENBAO_RECOVERY_KEY: >-
{{ (sys_token_store_users | default({}, true))
.get(OPENBAO_RECOVERY_USER_KEY, {})
.get('tokens', {})
.get(OPENBAO_RECOVERY_TOKEN_APP, '') }}
OPENBAO_SECRET_ID_REGISTERED: "{{ openbao_secret_id_registered | default('', true) }}"
OPENBAO_SECRET_ID_ROTATING: "{{ (OPENBAO_SECRET_ID_REGISTERED | length > 0) and (OPENBAO_SECRET_ID_REGISTERED != OPENBAO_APPROLE_SECRET_ID) }}"
OPENBAO_KV_MOUNT: "infinito"
OPENBAO_ANSIBLE_APPROLE: "ansible"
OPENBAO_PKI_MOUNT: "pki"
OPENBAO_PKI_ISSUING_ROLE: "internal"
OPENBAO_PKI_ISSUING_URL: "{{ OPENBAO_BASE_URL }}/v1/{{ OPENBAO_PKI_MOUNT }}/ca"
OPENBAO_PKI_CRL_URL: "{{ OPENBAO_BASE_URL }}/v1/{{ OPENBAO_PKI_MOUNT }}/crl"
OPENBAO_OIDC_ISSUER: "{{ OIDC.CLIENT.ISSUER_URL }}"
OPENBAO_OIDC_CLIENT_ID: "{{ OIDC.CLIENT.ID }}"
OPENBAO_OIDC_CLIENT_SECRET: "{{ OIDC.CLIENT.SECRET }}"
OPENBAO_OIDC_USER_CLAIM: "{{ OIDC.ATTRIBUTES.USERNAME }}"
OPENBAO_OIDC_GROUPS_CLAIM: "groups"
OPENBAO_OIDC_DEFAULT_ROLE: "default"
OPENBAO_OIDC_REDIRECT_URIS: >-
{{ [
OPENBAO_BASE_URL ~ '/v1/auth/oidc/callback',
OPENBAO_BASE_URL ~ '/ui/vault/auth/oidc/oidc/callback'
] | join(',') }}
OPENBAO_LDAP_URL: "ldap://{{ LDAP.SERVER.DOMAIN }}:{{ LDAP.SERVER.PORT }}"
OPENBAO_LDAP_USER_ATTR: "{{ LDAP.USER.ATTRIBUTES.ID }}"
OPENBAO_RBAC_ROLES:
- administrator
- operator
- reader