mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-352: Add the confluence config file and more environment settings.
This commit is contained in:
@@ -20,7 +20,7 @@ atl_product_home: "{{ atl_home_base }}/{{ atl_product_family }}"
|
||||
atl_product_shared_home_map:
|
||||
confluence: "shared-home"
|
||||
jira: "shared"
|
||||
stash: "FIXME"
|
||||
stash: "shared"
|
||||
atl_product_home_shared: "{{ atl_shared_mountpoint }}/{{ atl_product_family }}/{{ atl_product_shared_home_map[atl_product_family] }}"
|
||||
atl_product_shared_plugins: "{{ atl_product_home_shared }}/plugins/installed-plugins"
|
||||
|
||||
@@ -37,6 +37,7 @@ atl_installer_temp: "{{ atl_installation_base }}/tmp"
|
||||
atl_product_version: "{{ lookup('env', 'ATL_PRODUCT_VERSION') | lower }}"
|
||||
|
||||
atl_efs_id: "{{ lookup('env', 'ATL_EFS_ID') }}"
|
||||
atl_aws_stack_name: "{{ lookup('env', 'ATL_AWS_STACK_NAME') }}"
|
||||
|
||||
atl_db_host: "{{ lookup('env', 'ATL_DB_HOST') }}"
|
||||
atl_db_port: "{{ lookup('env', 'ATL_DB_PORT') or '5432' }}"
|
||||
|
||||
@@ -2,6 +2,22 @@
|
||||
|
||||
atl_jvm_heap: "2048m"
|
||||
|
||||
atl_db_timeout: "{{ lookup('env', 'ATL_DB_TIMEOUT') or '30' }}"
|
||||
atl_db_idletestperiod: "{{ lookup('env', 'ATL_DB_IDLETESTPERIOD') or '100' }}"
|
||||
atl_db_maxstatements: "{{ lookup('env', 'ATL_DB_MAXSTATEMENTS') or '0' }}"
|
||||
atl_db_validate: "{{ lookup('env', 'ATL_ATL_DB_VALIDATE') or 'false' }}"
|
||||
atl_db_acquireincrement: "{{ lookup('env', 'ATL_DB_ACQUIREINCREMENT') or '1' }}"
|
||||
|
||||
atl_hazelcast_network_aws_tag_key: "Cluster"
|
||||
atl_hazelcast_network_aws_host_header: "ec2.amazonaws.com"
|
||||
atl_hazelcast_network_aws_iam_region: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS_IAM_REGION') }}"
|
||||
atl_hazelcast_network_aws_iam_role: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS_IAM_ROLE') }}"
|
||||
atl_hazelcast_network_aws_tag_value: "{{ lookup('env', 'ATL_HAZELCAST_NETWORK_AWS_TAG_VALUE') }}"
|
||||
|
||||
atl_autologin_cookie_age: "{{ lookup('env', 'ATL_AUTOLOGIN_COOKIE_AGE') }}"
|
||||
atl_synchrony_service_url: "{{ lookup('env', 'ATL_SYNCHRONY_SERVICE_URL') }}"
|
||||
|
||||
|
||||
atl_catalina_opts: ""
|
||||
atl_catalina_opts_extra: >-
|
||||
-Datlassian.event.thread_pool_configuration.queue_size=4096
|
||||
@@ -14,8 +30,8 @@ atl_catalina_opts_extra: >-
|
||||
-XX:+PrintGCDetails
|
||||
-XX:+PrintTenuringDistribution
|
||||
-Dsynchrony.proxy.enabled=false
|
||||
-Dsynchrony.service.url=${ATL_SYNCHRONY_SERVICE_URL}
|
||||
-Dconfluence.cluster.node.name=${_ATL_PRIVATE_IPV4}
|
||||
-Dsynchrony.service.url={{ atl_synchrony_service_url }}
|
||||
-Dconfluence.cluster.node.name={{ ansible_ec2_local_ipv4 | default(ansible_default_ipv4.address) }}
|
||||
-Dconfluence.cluster.hazelcast.max.no.heartbeat.seconds=60
|
||||
|
||||
atl_tomcat_port: "8080"
|
||||
@@ -29,6 +45,3 @@ atl_tomcat_protocol: "HTTP/1.1"
|
||||
atl_tomcat_redirectport: ""
|
||||
atl_tomcat_scheme: "http"
|
||||
atl_tomcat_secure: "false"
|
||||
|
||||
atl_autologin_cookie_age: "{{ lookup('env', 'ATL_AUTOLOGIN_COOKIE_AGE') }}"
|
||||
atl_synchrony_service_url: "{{ lookup('env', 'ATL_SYNCHRONY_SERVICE_URL') }}"
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
atl_jvm_heap: 'PLACEHOLDER'
|
||||
atl_cluster_node_id: 'FAKEID'
|
||||
atl_autologin_cookie_age: "COOKIEAGE"
|
||||
ansible_ec2_local_ipv4: "1.1.1.1"
|
||||
ansible_default_ipv4: "2.2.2.2"
|
||||
|
||||
roles:
|
||||
- role: linux_common
|
||||
|
||||
@@ -16,6 +16,7 @@ def test_setenv_file(host):
|
||||
assert f.exists
|
||||
assert f.contains('-XmsPLACEHOLDER')
|
||||
assert f.contains('-XmxPLACEHOLDER')
|
||||
assert f.contains('-Dconfluence.cluster.node.name=1.1.1.1')
|
||||
|
||||
def test_server_file(host):
|
||||
f = host.file('/opt/atlassian/confluence/current/conf/server.xml')
|
||||
@@ -52,18 +53,9 @@ def test_home_directories(host, directory):
|
||||
assert d.exists
|
||||
assert d.user == 'confluence'
|
||||
|
||||
|
||||
# def test_dbconfig_file(host):
|
||||
# f = host.file('/var/atlassian/application-data/jira/dbconfig.xml')
|
||||
# assert f.exists
|
||||
# assert f.user == 'jira'
|
||||
# assert f.contains("<driver-class>org.postgresql.Driver</driver-class>")
|
||||
# assert f.contains("<username>atljira</username>")
|
||||
# assert f.contains("<pool-min-size>20</pool-min-size>")
|
||||
|
||||
|
||||
# def test_cluster_file(host):
|
||||
# f = host.file('/var/atlassian/application-data/jira/cluster.properties')
|
||||
# assert f.exists
|
||||
# assert f.contains('jira.node.id = FAKEID')
|
||||
# assert f.contains('jira.shared.home = /media/atl/jira/shared')
|
||||
def test_confluence_config_file(host):
|
||||
f = host.file('/var/atlassian/application-data/confluence/confluence.cfg.xml')
|
||||
assert f.exists
|
||||
assert f.user == 'confluence'
|
||||
assert f.contains('<property name="confluence.cluster.home">/media/atl/confluence/shared-home</property>')
|
||||
assert f.contains('<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>')
|
||||
|
||||
@@ -1,26 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Configure login properties
|
||||
template:
|
||||
src: seraph-config.xml.j2
|
||||
dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/seraph-config.xml"
|
||||
|
||||
- name: Override JVM memory settings.
|
||||
replace:
|
||||
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
||||
regexp: "-{{ item }}\\d+m "
|
||||
replace: "-{{ item }}{{ atl_jvm_heap }} "
|
||||
with_items:
|
||||
- 'Xmx'
|
||||
- 'Xms'
|
||||
|
||||
- name: Create server config
|
||||
template:
|
||||
src: server.xml.j2
|
||||
dest: "{{ atl_product_installation_versioned }}/conf/server.xml"
|
||||
|
||||
|
||||
|
||||
- name: Create application directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
@@ -35,6 +14,40 @@
|
||||
changed_when: false # For Molecule idempotence check
|
||||
|
||||
|
||||
- name: Create Tomcat server config
|
||||
template:
|
||||
src: server.xml.j2
|
||||
dest: "{{ atl_product_installation_versioned }}/conf/server.xml"
|
||||
|
||||
- name: Override JVM memory settings.
|
||||
replace:
|
||||
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
||||
regexp: "-{{ item }}\\d+m "
|
||||
replace: "-{{ item }}{{ atl_jvm_heap }} "
|
||||
with_items:
|
||||
- 'Xmx'
|
||||
- 'Xms'
|
||||
|
||||
- name: Set the Tomcat environment
|
||||
lineinfile:
|
||||
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
|
||||
insertafter: "EOF"
|
||||
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
||||
|
||||
|
||||
- name: Configure login properties
|
||||
template:
|
||||
src: seraph-config.xml.j2
|
||||
dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/seraph-config.xml"
|
||||
|
||||
- name: Create Confluence configuration
|
||||
template:
|
||||
src: confluence.cfg.xml.j2
|
||||
dest: "{{ atl_product_home }}/confluence.cfg.xml"
|
||||
owner: "{{ atl_product_user }}"
|
||||
group: "{{ atl_product_user }}"
|
||||
|
||||
|
||||
- name: Limit permissions on the installation directory
|
||||
file:
|
||||
path: "{{ atl_product_installation_versioned }}"
|
||||
|
||||
42
roles/confluence_config/templates/confluence.cfg.xml.j2
Normal file
42
roles/confluence_config/templates/confluence.cfg.xml.j2
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<confluence-configuration>
|
||||
|
||||
<setupStep>setupstart</setupStep>
|
||||
<setupType>custom</setupType>
|
||||
<buildNumber>0</buildNumber>
|
||||
|
||||
<properties>
|
||||
<property name="confluence.database.choice">postgresql</property>
|
||||
<property name="confluence.database.connection.type">database-type-standard</property>
|
||||
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect</property>
|
||||
<property name="webwork.multipart.saveDir">${localHome}/temp</property>
|
||||
<property name="attachments.dir">${confluenceHome}/attachments</property>
|
||||
|
||||
<property name="hibernate.connection.driver_class">{{ atl_db_driver }}</property>
|
||||
<property name="hibernate.connection.url">{{ atl_jdbc_url }}</property>
|
||||
<property name="hibernate.connection.username">{{ atl_jdbc_user }}</property>
|
||||
<property name="hibernate.connection.password">{{ atl_jdbc_password }}</property>
|
||||
<property name="hibernate.c3p0.min_size">{{ atl_db_poolminsize }}</property>
|
||||
<property name="hibernate.c3p0.max_size">{{ atl_db_poolmaxsize }}</property>
|
||||
<property name="hibernate.c3p0.timeout">{{ atl_db_timeout }}</property>
|
||||
<property name="hibernate.c3p0.idle_test_period">{{ atl_db_idletestperiod }}</property>
|
||||
<property name="hibernate.c3p0.max_statements">{{ atl_db_maxstatements }}</property>
|
||||
<property name="hibernate.c3p0.validate">{{ atl_db_validate }}</property>
|
||||
<property name="hibernate.c3p0.acquire_increment">{{ atl_db_acquireincrement }}</property>
|
||||
<property name="hibernate.c3p0.preferredTestQuery">select version();</property>
|
||||
|
||||
<property name="shared-home">{{ atl_product_home_shared }}</property>
|
||||
<property name="confluence.cluster">true</property>
|
||||
<property name="confluence.cluster.home">{{ atl_product_home_shared }}</property>
|
||||
<property name="confluence.cluster.aws.iam.role">{{ atl_hazelcast_network_aws_iam_role }}</property>
|
||||
<property name="confluence.cluster.aws.region">{{ atl_hazelcast_network_aws_iam_region }}</property>
|
||||
<property name="confluence.cluster.aws.host.header">{{ atl_hazelcast_network_aws_host_header }}</property>
|
||||
<property name="confluence.cluster.aws.tag.key">{{ atl_hazelcast_network_aws_tag_key }}</property>
|
||||
<property name="confluence.cluster.aws.tag.value">{{ atl_hazelcast_network_aws_tag_value }}</property>
|
||||
<property name="confluence.cluster.join.type">aws</property>
|
||||
<property name="confluence.cluster.name">{{ atl_aws_stack_name }}</property>
|
||||
<property name="confluence.cluster.ttl">1</property>
|
||||
|
||||
</properties>
|
||||
</confluence-configuration>
|
||||
Reference in New Issue
Block a user