mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-17 15:56:04 +02:00
web-app-xwiki: verify extensions via Groovy page + new filter
- Added new filter 'xwiki_extension_status' (strips HTML, handles ) -> returns 200/404 - Introduced checker tasks (_check_extension_via_groovy.yml) instead of REST probe - Added early assert: superadmin login before extension installation - Collect and assert probe results in 04_extensions.yml - Set OIDC extension version to 'latest' (empty string) https://chatgpt.com/share/68ca36cb-ac38-800f-8281-8dea480b6676
This commit is contained in:
@@ -57,6 +57,39 @@
|
||||
delay: 15
|
||||
until: _exec_page is succeeded
|
||||
|
||||
- name: "XWIKI | Verify requested extensions via Groovy checker"
|
||||
include_tasks: _check_extension_via_groovy.yml
|
||||
loop: "{{ XWIKI_PLUGINS }}"
|
||||
loop_control:
|
||||
loop_var: plugin
|
||||
label: "{{ plugin.id }}"
|
||||
vars:
|
||||
ext_id: "{{ plugin.id }}"
|
||||
result_var: "probe_{{ plugin.id | regex_replace('[^A-Za-z0-9_]', '_') }}"
|
||||
|
||||
- name: "XWIKI | Collect probe results"
|
||||
set_fact:
|
||||
_xwiki_probe_results: "{{ _xwiki_probe_results | default([]) + [ {
|
||||
'id': plugin.id,
|
||||
'status': (
|
||||
(hostvars[inventory_hostname]['probe_' ~ (plugin.id | regex_replace('[^A-Za-z0-9_]', '_'))]
|
||||
| default({})).status
|
||||
| default(404) | int
|
||||
)
|
||||
} ] }}"
|
||||
loop: "{{ XWIKI_PLUGINS }}"
|
||||
loop_control:
|
||||
loop_var: plugin
|
||||
changed_when: false
|
||||
|
||||
# Fail if any extension is missing
|
||||
- name: "XWIKI | Assert all requested extensions are installed"
|
||||
vars:
|
||||
missing: "{{ _xwiki_probe_results | selectattr('status','equalto',404) | map(attribute='id') | list }}"
|
||||
fail:
|
||||
msg: "Missing extensions: {{ missing | join(', ') }}"
|
||||
when: missing | length > 0
|
||||
|
||||
- name: "XWIKI | Delete installer page"
|
||||
uri:
|
||||
url: "{{ [XWIKI_REST_XWIKI_PAGES, 'InstallExtensions'] | url_join }}"
|
||||
|
Reference in New Issue
Block a user