Files
computer-playbook/roles/web-app-xwiki/tasks/01_core.yml
Kevin Veen-Birkenbach 2d71c461de web-app-xwiki: add SuperAdmin bootstrap support
- Added schema entry for superadminpassword
- Added vars for XWIKI_SUPERADMIN_USERNAME/PASSWORD
- Extended xwiki.properties.j2 to configure superadminpassword
- Added 02_bootstrap_admin.yml to create XWiki admin via REST using SuperAdmin
- Updated REST URLs to use XWIKI_REST_GENERAL
- Enabled CSP flag unsafe-inline

Conversation: https://chatgpt.com/share/68c39ddb-e9cc-800f-b32f-9d4c1e09e43e
2025-09-12 06:13:34 +02:00

70 lines
2.0 KiB
YAML

- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: false
- name: "Render xwiki.cfg"
template:
src: "xwiki.cfg.j2"
dest: "{{ XWIKI_HOST_CONF_PATH }}"
notify: docker compose up
- name: "Render xwiki.properties"
template:
src: "xwiki.properties.j2"
dest: "{{ XWIKI_HOST_PROPERTIES_PATH }}"
notify: docker compose up
- name: "flush docker compose for '{{ application_id }}'"
meta: flush_handlers
- name: "Wait until XWiki REST is ready"
uri:
url: "http://127.0.0.1:{{ XWIKI_HOST_PORT }}/xwiki/rest/"
status_code: [200, 401]
return_content: no
register: xwiki_rest_up
retries: 60
delay: 5
until: xwiki_rest_up is succeeded
- include_tasks: 02_bootstrap_admin.yml
- name: "Check if OIDC extension installed"
uri:
url: "{{ XWIKI_REST_GENERAL }}/extensions/{{ XWIKI_EXT_OIDC_ID | urlencode }}"
method: GET
user: "{{ XWIKI_ADMIN_USER }}"
password: "{{ XWIKI_ADMIN_PASS }}"
force_basic_auth: yes
status_code: [200,404]
register: xwiki_oidc_ext
when: XWIKI_OIDC_ENABLED | bool
- name: "Check if LDAP extension installed"
uri:
url: "{{ XWIKI_REST_GENERAL }}/extensions/{{ XWIKI_EXT_LDAP_ID | urlencode }}"
method: GET
user: "{{ XWIKI_ADMIN_USER }}"
password: "{{ XWIKI_ADMIN_PASS }}"
force_basic_auth: yes
status_code: [200,404]
register: xwiki_ldap_ext
when: XWIKI_LDAP_ENABLED | bool
- name: "Install LDAP and/or OIDC extensions"
uri:
url: "{{ XWIKI_REST_BASE }}"
method: PUT
user: "{{ XWIKI_ADMIN_USER }}"
password: "{{ XWIKI_ADMIN_PASS }}"
force_basic_auth: yes
headers: { Content-Type: "text/xml" }
body: "{{ lookup('template', 'installjobrequest.xml.j2') }}"
status_code: 200
when:
- (XWIKI_OIDC_ENABLED | bool and xwiki_oidc_ext.status == 404) or
(XWIKI_LDAP_ENABLED | bool and (xwiki_ldap_ext is not skipped) and xwiki_ldap_ext.status == 404)
- include_tasks: utils/run_once.yml