From c3fd34b134c15fe8030328543e4b978c370f9fb4 Mon Sep 17 00:00:00 2001 From: Brett Meehan Date: Thu, 28 Nov 2019 14:35:41 +1100 Subject: [PATCH] ITOPSENG-277 handle updating base_url --- aws_confluence_dc_node.yml | 4 +++- bin/ansible-with-atl-env | 2 ++ roles/confluence_config/tasks/main.yml | 13 ++++++++++++- .../templates/seraph-config.xml.j2 | 6 +++--- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/aws_confluence_dc_node.yml b/aws_confluence_dc_node.yml index 979f96b..f2f9a34 100644 --- a/aws_confluence_dc_node.yml +++ b/aws_confluence_dc_node.yml @@ -7,10 +7,12 @@ atl_product_family: "confluence" atl_product_user: "confluence" atl_product_edition: "confluence" - atl_jdbc_encoding: 'UTF-8' atl_jdbc_collation: 'en_US.UTF-8' + vars_files: + - /etc/atl_vars.yml + roles: - role: linux_common - role: aws_common diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index 3685381..bc97f57 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -10,6 +10,8 @@ ENV_FILE=${4:-"/etc/atl"} export PATH=/usr/local/bin:$PATH +# get /etc/atl into usable vars which can be included in ansible playbooks +grep -v PASSWORD /etc/atl | sed -r -e 's/(^.+)(=)(.*$)/\L\1:\ \3/g' > /etc/atl_vars.yml # Set the environment with default exports set -a diff --git a/roles/confluence_config/tasks/main.yml b/roles/confluence_config/tasks/main.yml index f1e69fc..b8b5131 100644 --- a/roles/confluence_config/tasks/main.yml +++ b/roles/confluence_config/tasks/main.yml @@ -52,7 +52,6 @@ owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" - - name: Limit permissions on the installation directory file: path: "{{ atl_product_installation_versioned }}" @@ -79,3 +78,15 @@ - "{{ 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 bandana set bandanavalue=regexp_replace(%s, %s, %s) where bandanacontext = '_GLOBAL' and bandanakey = 'atlassian.confluence.settings'; + positional_args: + - bandanavalue + - .* + - "{{ atl_tomcat_scheme }}://{{ atl_proxy_name }}" diff --git a/roles/confluence_config/templates/seraph-config.xml.j2 b/roles/confluence_config/templates/seraph-config.xml.j2 index 8c91e87..5839e9a 100644 --- a/roles/confluence_config/templates/seraph-config.xml.j2 +++ b/roles/confluence_config/templates/seraph-config.xml.j2 @@ -1,4 +1,4 @@ - +grep login.url @@ -16,8 +16,8 @@ login.cookie.key seraph.confluence - - {% if atl_autologin_cookie_age is defined and atl_autologin_cookie_age|length %} + + {% if atl_autologin_cookie_age is defined and atl_autologin_cookie_age is not none %} autologin.cookie.age {{ atl_autologin_cookie_age }}