Merged in ITOPSENG-127-remove-duplicate-jira-jvm-o (pull request #85)

ITOPSENG-127 one CATALINA_OPT per line

* ITOPSENG-127 working on removing some of the duplicate CATALINA_OPTS in setenv.sh

* ITOPSENG-127 remove double dashes

* ITOPSENG-127 removing old tasks for adding CATALINA_OPTS

Approved-by: Ben Partridge <bpartridge@atlassian.com>
This commit is contained in:
Geoff Jacobs
2020-02-25 02:10:52 +00:00
parent 62be884f34
commit 81c2bc9fe8
2 changed files with 24 additions and 8 deletions

View File

@@ -24,17 +24,28 @@
path: "{{ atl_product_installation_versioned }}/crowd-webapp/WEB-INF/classes/crowd-init.properties" path: "{{ atl_product_installation_versioned }}/crowd-webapp/WEB-INF/classes/crowd-init.properties"
line: 'crowd.home={{ atl_product_home }}' line: 'crowd.home={{ atl_product_home }}'
- name: Set the Tomcat environment - name: Export CATALINA_OPTS in setenv.sh
lineinfile: lineinfile:
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" path: '{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh'
insertafter: "EOF" line: 'export CATALINA_OPTS'
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
- name: Set the Crowd node name via CATALINA_OPTS - name: CATALINA_OPTS to list
lineinfile: set_fact:
catalina_ops_list: "{{ catalina_ops_list|default([]) }} + {{ (item | trim | regex_replace('^-')).split(' -') }}"
loop:
- '{{ atl_catalina_opts }}'
- '{{ atl_catalina_opts_extra }}'
- name: CATALINA_OPTS unique and sorted
set_fact:
catalina_opts: "{{ query('flattened', catalina_ops_list) | unique | sort }}"
- name: Set CATALINA_OPTS in setenv.sh
blockinfile:
block: "{{ lookup('template', 'templates/catalina_opts.j2') }}"
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
insertafter: "EOF" insertbefore: "^export CATALINA_OPTS$"
line: export CATALINA_OPTS="${CATALINA_OPTS} -Dcluster.node.name={{ ansible_ec2_instance_id }}-{{ ansible_ec2_local_ipv4 }}" marker: "# {mark} ANSIBLE MANAGED CATALINA_OPTS"
- name: Set JAVA_HOME - name: Set JAVA_HOME
lineinfile: lineinfile:

View File

@@ -0,0 +1,5 @@
{% for item in catalina_opts %}
CATALINA_OPTS="${CATALINA_OPTS} -{{ item }}"
{% endfor %}
CATALINA_OPTS="${CATALINA_OPTS} -Dcluster.node.name={{ ansible_ec2_instance_id }}-{{ ansible_ec2_local_ipv4 }}"