From 57ad0666615ba1b4a722cc316f80b6a9ffb90e5d Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Mon, 3 Nov 2025 15:31:37 +1100 Subject: [PATCH] WPTIN-15452 Change base_url assert to support the change in Confluence 10.1+ to plugin_setting --- roles/confluence_config/tasks/main.yml | 41 +++++++++++++++++++------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/roles/confluence_config/tasks/main.yml b/roles/confluence_config/tasks/main.yml index 00854ff..1bea153 100644 --- a/roles/confluence_config/tasks/main.yml +++ b/roles/confluence_config/tasks/main.yml @@ -125,17 +125,36 @@ changed_when: false # For Molecule idempotence check - name: Assert baseurl to same as atl_proxy_name - community.postgresql.postgresql_query: - login_host: "{{ atl_db_host }}" - login_user: "{{ atl_jdbc_user }}" - login_password: "{{ atl_jdbc_password }}" - db: "{{ atl_jdbc_db_name }}" - query: > - update bandana set bandanavalue=regexp_replace(bandanavalue, %s, %s) - where bandanacontext = '_GLOBAL' and bandanakey = 'atlassian.confluence.settings'; - positional_args: - - ".*" - - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}" + block: + # For Confluence 10.1+ - use plugin_setting table with JSON format + - name: Assert baseurl to same as atl_proxy_name (Confluence 10.1+) + community.postgresql.postgresql_query: + login_host: "{{ atl_db_host }}" + login_user: "{{ atl_jdbc_user }}" + login_password: "{{ atl_jdbc_password }}" + db: "{{ atl_jdbc_db_name }}" + query: > + update plugin_setting set setting_value=regexp_replace(setting_value, %s, %s) + where namespace = '_GLOBAL' and setting_key = 'atlassian.confluence.settings'; + positional_args: + - "\"baseUrl\":.*?," + - "\"baseUrl\":\"{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}\"," + when: atl_product_version is version('10.1', '>=') + + # For Confluence < 10.1 - use bandana table with XML format + - name: Assert baseurl to same as atl_proxy_name (Confluence < 10.1) + community.postgresql.postgresql_query: + login_host: "{{ atl_db_host }}" + login_user: "{{ atl_jdbc_user }}" + login_password: "{{ atl_jdbc_password }}" + db: "{{ atl_jdbc_db_name }}" + query: > + update bandana set bandanavalue=regexp_replace(bandanavalue, %s, %s) + where bandanacontext = '_GLOBAL' and bandanakey = 'atlassian.confluence.settings'; + positional_args: + - ".*" + - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}" + when: atl_product_version is version('10.1', '<') when: - atl_proxy_name is defined - atl_tomcat_scheme is defined