From 2513450d07a15b30f44af06a54ab0c016dc8e964 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Wed, 30 Oct 2019 10:49:39 +1100 Subject: [PATCH 1/4] ITOPSENG-283 updating the method for managing the xmx and xms settings in setenv.sh --- roles/crowd_config/tasks/main.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index f6e8493..ea31775 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -5,16 +5,19 @@ src: server.xml.j2 dest: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/server.xml" -- name: Override JVM memory settings. - # Ugly but necessary as the product installs this file so we need to make the change here. +- name: Set the minimum heap size (Xms) lineinfile: path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" - backrefs: true - regexp: "^{{ item }}=" - line: "{{ item }}=\"{{ atl_jvm_heap }}\"" - with_items: - - 'JVM_MINIMUM_MEMORY' - - 'JVM_MAXIMUM_MEMORY' + regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' + line: '\1Xms${atl_jvm_heap}\3' + backrefs: yes + +- name: Set the maxmimum heap size (Xmx) + lineinfile: + path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" + regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' + line: '\1Xmx${xms}m\3' + backrefs: yes - name: Set Crowd home directory in crowd-init.properties file lineinfile: From 5032371fed22d753cb2f3e9936be533bf26ec85f Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Wed, 30 Oct 2019 11:14:39 +1100 Subject: [PATCH 2/4] ITOPSENG-283 fixing typo and adding debug --- roles/crowd_config/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index ea31775..3b5afdc 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -11,13 +11,15 @@ regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' line: '\1Xms${atl_jvm_heap}\3' backrefs: yes + verbosity: 4 - name: Set the maxmimum heap size (Xmx) lineinfile: path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' - line: '\1Xmx${xms}m\3' + line: '\1Xmx${atl_jvm_heap}\3' backrefs: yes + verbosity: 4 - name: Set Crowd home directory in crowd-init.properties file lineinfile: From 7d90e8b65a91dee94a4a5dfea90561f7c4a1cd01 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Wed, 30 Oct 2019 11:21:34 +1100 Subject: [PATCH 3/4] ITOPSENG-283 more debug --- bin/ansible-with-atl-env | 2 +- roles/crowd_config/tasks/main.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index 3685381..b3e05e0 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -18,7 +18,7 @@ set +a # Use Ansible from virtualenv if provided pipenv run \ - ansible-playbook -v \ + ansible-playbook -vvvv \ $ATL_DEPLOYMENT_REPOSITORY_CUSTOM_PARAMS \ -i $INV \ $PLAYBOOK \ diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index 3b5afdc..817ad2e 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -11,7 +11,6 @@ regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' line: '\1Xms${atl_jvm_heap}\3' backrefs: yes - verbosity: 4 - name: Set the maxmimum heap size (Xmx) lineinfile: @@ -19,7 +18,6 @@ regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' line: '\1Xmx${atl_jvm_heap}\3' backrefs: yes - verbosity: 4 - name: Set Crowd home directory in crowd-init.properties file lineinfile: From ee759efeadefd9a0d7cebb9656660770f23613a0 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Wed, 30 Oct 2019 11:45:57 +1100 Subject: [PATCH 4/4] ITOPSENG-283 upstream ansible example had wrong syntax :facepalm: --- bin/ansible-with-atl-env | 2 +- roles/crowd_config/tasks/main.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index b3e05e0..3685381 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -18,7 +18,7 @@ set +a # Use Ansible from virtualenv if provided pipenv run \ - ansible-playbook -vvvv \ + ansible-playbook -v \ $ATL_DEPLOYMENT_REPOSITORY_CUSTOM_PARAMS \ -i $INV \ $PLAYBOOK \ diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index 817ad2e..b5b987c 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -8,15 +8,15 @@ - name: Set the minimum heap size (Xms) lineinfile: path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" - regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' - line: '\1Xms${atl_jvm_heap}\3' + regexp: '^(.*)Xms(\d+\w)(\s.*)$' + line: '\1Xms{{ atl_jvm_heap }}\3' backrefs: yes - name: Set the maxmimum heap size (Xmx) lineinfile: path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" - regexp: '^(.*)Xmx(\\d+\\w)(\\s.*)$' - line: '\1Xmx${atl_jvm_heap}\3' + regexp: '^(.*)Xmx(\d+\w)(\s.*)$' + line: '\1Xmx{{ atl_jvm_heap }}\3' backrefs: yes - name: Set Crowd home directory in crowd-init.properties file