From 4b96222991285d4317d182b03d44a1b6f418a60d Mon Sep 17 00:00:00 2001 From: Brett Meehan Date: Mon, 6 Jan 2020 15:14:31 +1100 Subject: [PATCH 1/3] ITOPSENG-359 fix jira base_url on clone and add contextpath to both confluence and jira --- roles/confluence_config/tasks/main.yml | 2 +- roles/jira_config/tasks/main.yml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/roles/confluence_config/tasks/main.yml b/roles/confluence_config/tasks/main.yml index e086d09..b777d7a 100644 --- a/roles/confluence_config/tasks/main.yml +++ b/roles/confluence_config/tasks/main.yml @@ -108,7 +108,7 @@ where bandanacontext = '_GLOBAL' and bandanakey = 'atlassian.confluence.settings'; positional_args: - ".*" - - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}" + - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}" when: - atl_proxy_name is defined - atl_tomcat_scheme is defined diff --git a/roles/jira_config/tasks/main.yml b/roles/jira_config/tasks/main.yml index cfa0bb6..28c8042 100644 --- a/roles/jira_config/tasks/main.yml +++ b/roles/jira_config/tasks/main.yml @@ -87,3 +87,19 @@ - "{{ atl_product_installation_versioned }}/temp" - "{{ atl_product_installation_versioned }}/work" changed_when: false # For Molecule idempotence check + +- name: Assert baseurl to same as atl_proxy_name + postgresql_query: + login_host: "{{ atl_db_host }}" + login_user: "{{ atl_jdbc_user }}" + login_password: "{{ atl_jdbc_password }}" + db: "{{ atl_jdbc_db_name }}" + query: > + update propertystring set propertyvalue=%s + where id=(select id from propertyentry where property_key = 'jira.baseurl') + positional_args: + - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}" + when: + - atl_proxy_name is defined + - atl_tomcat_scheme is defined + ignore_errors: yes # For Molecule as it has no db test framework included From 6b6d5ba3a4523235ae0301fdc4c50a0c895fcfff Mon Sep 17 00:00:00 2001 From: Brett Meehan Date: Mon, 6 Jan 2020 15:55:29 +1100 Subject: [PATCH 2/3] ITOPSENG-359 fixing context_path for crowd while im at it --- roles/crowd_config/tasks/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index b5b987c..1827975 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -91,3 +91,19 @@ owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" changed_when: false # For Molecule idempotence check + +- name: Assert baseurl to same as atl_proxy_name + postgresql_query: + login_host: "{{ atl_db_host }}" + login_user: "{{ atl_jdbc_user }}" + login_password: "{{ atl_jdbc_password }}" + db: "{{ atl_jdbc_db_name }}" + query: > + update cwd_property set property_value=%s + where property_name = 'base.url' + positional_args: + - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}{{ atl_tomcat_contextpath }}/crowd" + when: + - atl_proxy_name is defined + - atl_tomcat_scheme is defined + ignore_errors: yes # For Molecule as it has no db test framework included From 2784eec651889d99f002b428fa0ae480ba401377 Mon Sep 17 00:00:00 2001 From: Brett Meehan Date: Tue, 7 Jan 2020 10:54:04 +1100 Subject: [PATCH 3/3] ITOPSENG-359 ignore base_url updates if db was just created --- roles/confluence_config/tasks/main.yml | 1 + roles/crowd_config/tasks/main.yml | 1 + roles/jira_config/tasks/main.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/roles/confluence_config/tasks/main.yml b/roles/confluence_config/tasks/main.yml index b777d7a..c20a1dc 100644 --- a/roles/confluence_config/tasks/main.yml +++ b/roles/confluence_config/tasks/main.yml @@ -112,4 +112,5 @@ when: - atl_proxy_name is defined - atl_tomcat_scheme is defined + - not db_created.changed ignore_errors: yes # For Molecule as it has no db test framework included diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index 1827975..5062080 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -106,4 +106,5 @@ when: - atl_proxy_name is defined - atl_tomcat_scheme is defined + - not db_created.changed ignore_errors: yes # For Molecule as it has no db test framework included diff --git a/roles/jira_config/tasks/main.yml b/roles/jira_config/tasks/main.yml index 28c8042..de2d9d3 100644 --- a/roles/jira_config/tasks/main.yml +++ b/roles/jira_config/tasks/main.yml @@ -102,4 +102,5 @@ when: - atl_proxy_name is defined - atl_tomcat_scheme is defined + - not db_created.changed ignore_errors: yes # For Molecule as it has no db test framework included