From 155993efff4ca45313f2d53b527c4a97f0373e1a Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Wed, 8 Jan 2020 13:59:58 +1100 Subject: [PATCH] ITOPSENG-366 handle cloned crowd db connections --- .gitignore | 3 ++- roles/crowd_config/tasks/main.yml | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 64c8c51..321ff61 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ __pycache__ *.pyc /.venv \#*\# -.idea \ No newline at end of file +.idea +.vscode diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index 5062080..eaec021 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -55,7 +55,6 @@ - "{{ atl_product_shared_plugins }}" changed_when: false # For Molecule idempotence check - - name: Limit permissions on the installation directory file: path: "{{ atl_product_installation_versioned }}" @@ -108,3 +107,22 @@ - atl_tomcat_scheme is defined - not db_created.changed ignore_errors: yes # For Molecule as it has no db test framework included + +- name: Check that crowd.cfg.xml exists + stat: + path: "{{ atl_product_home_shared }}/crowd.cfg.xml" + register: crowd_cfg_stat_result + +- name: Assert JDBC password to same as atl_jdbc_password + xml: + path: "{{ atl_product_home_shared }}/crowd.cfg.xml" + xpath: "/application-configuration/properties/property[@name='hibernate.connection.password']" + value: "{{ atl_jdbc_password }}" + when: crowd_cfg_stat_result.stat.exists + +- name: Assert JDBC url to same as atl_jdbc_url + xml: + path: "{{ atl_product_home_shared }}/crowd.cfg.xml" + xpath: "/application-configuration/properties/property[@name='hibernate.connection.url']" + value: "{{ atl_jdbc_url }}?reWriteBatchedInserts=true" + when: crowd_cfg_stat_result.stat.exists \ No newline at end of file