diff --git a/group_vars/all.yml b/group_vars/all.yml index 3c0a8fc..aa79201 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -2,8 +2,12 @@ # This file is the place for cross-role defaults for all products, and # common parameters from the infrastructure-deployment phase of the -# build (e.g. CloudFormation). More specific vars should go in -# /defaults/main.yml or in the various playbooks. +# build (e.g. CloudFormation). Variables defined here will override +# those defined in `/defaults/main.yml`, although defaults +# should usually be defined there too. For variable precedence +# information see: +# +# https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html java_version: "1.8.0" postgres_version: "9.6" @@ -47,12 +51,17 @@ atl_jdbc_url: "jdbc:postgresql://{{ atl_db_host }}:{{ atl_db_port }}/{{ atl_jdbc atl_jvm_heap: "{{ lookup('env', 'ATL_JVM_HEAP') or '2048m' }}" atl_catalina_opts: "{{ lookup('env', 'ATL_CATALINA_OPTS') or '' }}" -atl_catalina_opts_extra: >- - -XX:+UseG1GC - -XX:+PrintAdaptiveSizePolicy - -XX:+PrintGCDetails - -XX:NumberOfGCLogFiles=10 - -XX:GCLogFileSize=5m - -XX:+UseGCLogFileRotation - -XX:+PrintTenuringDistribution - -Dfile.encoding=UTF-8 +atl_proxy_name: "{{ lookup('env', 'ATL_PROXY_NAME') }}" +atl_proxy_port: "{{ lookup('env', 'ATL_TOMCAT_PROXYPORT') }}" +atl_tomcat_port: "{{ lookup('env', 'ATL_TOMCAT_DEFAULTCONNECTORPORT') or '8080' }}" + +atl_tomcat_acceptcount: "{{ lookup('env', 'ATL_TOMCAT_ACCEPTCOUNT') or '10' }}" +atl_tomcat_connectiontimeout: "{{ lookup('env', 'ATL_TOMCAT_CONNECTIONTIMEOUT') or '20000' }}" +atl_tomcat_contextpath: "{{ lookup('env', 'ATL_TOMCAT_CONTEXTPATH') or '' }}" +atl_tomcat_enablelookups: "{{ lookup('env', 'ATL_TOMCAT_ENABLELOOKUPS') or 'false' }}" +atl_tomcat_maxthreads: "{{ lookup('env', 'ATL_TOMCAT_MAXTHREADS') or '200' }}" +atl_tomcat_minsparethreads: "{{ lookup('env', 'ATL_TOMCAT_MINSPARETHREADS') or '10' }}" +atl_tomcat_protocol: "{{ lookup('env', 'ATL_TOMCAT_PROTOCOL') or 'HTTP/1.1' }}" +atl_tomcat_redirectport: "{{ lookup('env', 'ATL_TOMCAT_REDIRECTPORT') or '' }}" +atl_tomcat_scheme: "{{ lookup('env', 'ATL_TOMCAT_SCHEME') or 'http' }}" +atl_tomcat_secure: "{{ lookup('env', 'ATL_TOMCAT_SECURE') or 'false' }}" diff --git a/roles/jira_config/defaults/main.yml b/roles/jira_config/defaults/main.yml new file mode 100644 index 0000000..02f6366 --- /dev/null +++ b/roles/jira_config/defaults/main.yml @@ -0,0 +1,26 @@ +--- + +atl_jvm_heap: "2048m" + +atl_catalina_opts: "" +atl_catalina_opts_extra: >- + -XX:+UseG1GC + -XX:+PrintAdaptiveSizePolicy + -XX:+PrintGCDetails + -XX:NumberOfGCLogFiles=10 + -XX:GCLogFileSize=5m + -XX:+UseGCLogFileRotation + -XX:+PrintTenuringDistribution + -Dfile.encoding=UTF-8 + +atl_tomcat_port: "8080" +atl_tomcat_mgmt_port: "8005" +atl_tomcat_acceptcount: "10" +atl_tomcat_connectiontimeout: "20000" +atl_tomcat_contextpath: "false" +atl_tomcat_maxthreads: "200" +atl_tomcat_minsparethreads: "10" +atl_tomcat_protocol: "HTTP/1.1" +atl_tomcat_redirectport: "" +atl_tomcat_scheme: "http" +atl_tomcat_secure: "false" diff --git a/roles/jira_config/molecule/default/tests/test_default.py b/roles/jira_config/molecule/default/tests/test_default.py index 0588d7b..583e9fb 100644 --- a/roles/jira_config/molecule/default/tests/test_default.py +++ b/roles/jira_config/molecule/default/tests/test_default.py @@ -25,3 +25,10 @@ def test_cluster_file(host): assert f.exists assert f.contains('jira.node.id = FAKEID') assert f.contains('jira.shared.home = /media/atl/jira/shared') + +def test_server_file(host): + f = host.file('/opt/atlassian/jira-software/current/conf/server.xml') + assert f.exists + assert f.contains('Connector port="8080"') + assert f.contains('Server port="8005"') + assert not f.contains('proxyName=') diff --git a/roles/jira_config/tasks/main.yml b/roles/jira_config/tasks/main.yml index 3f08170..96de31e 100644 --- a/roles/jira_config/tasks/main.yml +++ b/roles/jira_config/tasks/main.yml @@ -12,6 +12,11 @@ dest: "{{ atl_product_home }}/cluster.properties" owner: "{{ atl_product_user }}" +- name: Create server config + template: + src: server.xml.j2 + dest: "{{ atl_product_installation_target }}/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. lineinfile: diff --git a/roles/jira_config/templates/server.xml.j2 b/roles/jira_config/templates/server.xml.j2 new file mode 100644 index 0000000..9314ff8 --- /dev/null +++ b/roles/jira_config/templates/server.xml.j2 @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +