mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
Merged in DCD-373-db-properties (pull request #2)
DCD-373: Propagate DB properties from Quickstart to dbconfig.xml
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
## Introduction
|
||||
|
||||
This repository is a suite of Ansible roles, playbooks and support scripts to
|
||||
automate the installation and maintenance of Atlassian Data-Center products in
|
||||
automate the installation and maintenance of Atlassian Data Center products in
|
||||
cloud environments.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -43,11 +43,20 @@ atl_db_host: "{{ lookup('env', 'ATL_DB_HOST') }}"
|
||||
atl_db_port: "{{ lookup('env', 'ATL_DB_PORT') or '5432' }}"
|
||||
atl_db_root_user: "{{ lookup('env', 'ATL_DB_ROOT_USER') or 'postgres' }}"
|
||||
atl_db_root_password: "{{ lookup('env', 'ATL_DB_ROOT_PASSWORD') }}"
|
||||
atl_db_driver: "{{ lookup('env', 'ATL_DB_DRIVER') or 'org.postgresql.Driver' }}"
|
||||
|
||||
atl_db_poolminsize: "{{ lookup('env', 'ATL_DB_POOLMINSIZE') or '20' }}"
|
||||
atl_db_poolmaxsize: "{{ lookup('env', 'ATL_DB_POOLMAXSIZE') or '100' }}"
|
||||
atl_db_minidle: "{{ lookup('env', 'ATL_DB_MINIDLE') or '10' }}"
|
||||
atl_db_maxidle: "{{ lookup('env', 'ATL_DB_MAXIDLE') or '20' }}"
|
||||
atl_db_driver: "{{ lookup('env', 'ATL_DB_DRIVER') or 'org.postgresql.Driver' }}"
|
||||
|
||||
atl_db_maxwaitmillis: "{{ lookup('env', 'ATL_DB_MAXWAITMILLIS') or '30000' }}"
|
||||
atl_db_timebetweenevictionrunsmillis: "{{ lookup('env', 'ATL_DB_TIMEBETWEENEVICTIONRUNSMILLIS') or '30000' }}"
|
||||
atl_db_minevictableidletimemillis: "{{ lookup('env', 'ATL_DB_MINEVICTABLEIDLETIMEMILLIS') or '5000' }}"
|
||||
atl_db_removeabandoned: "{{ lookup('env', 'ATL_DB_REMOVEABANDONED') or 'true' }}"
|
||||
atl_db_removeabandonedtimeout: "{{ lookup('env', 'ATL_DB_REMOVEABANDONEDTIMEOUT') or '300' }}"
|
||||
atl_db_testwhileidle: "{{ lookup('env', 'ATL_DB_TESTWHILEIDLE') or 'true'}}"
|
||||
atl_db_testonborrow: "{{ lookup('env', 'ATL_DB_TESTONBORROW') or 'false' }}"
|
||||
|
||||
atl_jdbc_db_name: "{{ lookup('env', 'ATL_JDBC_DB_NAME') }}"
|
||||
atl_jdbc_user: "{{ lookup('env', 'ATL_JDBC_USER') }}"
|
||||
|
||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
ansible==2.7.10
|
||||
molecule==2.20.1
|
||||
docker==4.0.1
|
||||
@@ -21,3 +21,16 @@ atl_tomcat_protocol: "HTTP/1.1"
|
||||
atl_tomcat_redirectport: ""
|
||||
atl_tomcat_scheme: "http"
|
||||
atl_tomcat_secure: "false"
|
||||
|
||||
atl_db_poolminsize: '20'
|
||||
atl_db_poolmaxsize: '100'
|
||||
atl_db_minidle: '10'
|
||||
atl_db_maxidle: '20'
|
||||
|
||||
atl_db_maxwaitmillis: '30000'
|
||||
atl_db_timebetweenevictionrunsmillis: '30000'
|
||||
atl_db_minevictableidletimemillis: '5000'
|
||||
atl_db_removeabandoned: 'true'
|
||||
atl_db_removeabandonedtimeout: '300'
|
||||
atl_db_testwhileidle: 'true'
|
||||
atl_db_testonborrow: 'false'
|
||||
|
||||
@@ -10,10 +10,14 @@ platforms:
|
||||
image: amazonlinux:2
|
||||
groups:
|
||||
- aws_node_local
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
- name: ubuntu_lts
|
||||
image: ubuntu:bionic
|
||||
groups:
|
||||
- aws_node_local
|
||||
ulimits:
|
||||
- nofile:262144:262144
|
||||
provisioner:
|
||||
name: ansible
|
||||
options:
|
||||
|
||||
@@ -6,9 +6,23 @@
|
||||
atl_product_edition: "jira-software"
|
||||
atl_product_user: "jira"
|
||||
atl_product_version: "7.13.2"
|
||||
|
||||
# dbconfig.xml variables
|
||||
atl_jdbc_user: 'atljira'
|
||||
atl_jdbc_password: 'molecule_password'
|
||||
atl_jvm_heap: 'PLACEHOLDER'
|
||||
atl_cluster_node_id: 'FAKEID'
|
||||
atl_db_poolminsize: 1111
|
||||
atl_db_poolmaxsize: 1111
|
||||
atl_db_minidle: 1111
|
||||
atl_db_maxidle: 1111
|
||||
atl_db_maxwaitmillis: 1111
|
||||
atl_db_minevictableidletimemillis: 1111
|
||||
atl_db_timebetweenevictionrunsmillis: 1111
|
||||
atl_db_removeabandoned: 'false'
|
||||
atl_db_removeabandonedtimeout: 1111
|
||||
atl_db_testwhileidle: 'false'
|
||||
atl_db_testonborrow: 'true'
|
||||
|
||||
roles:
|
||||
- role: linux_common
|
||||
|
||||
@@ -12,7 +12,23 @@ def test_dbconfig_file(host):
|
||||
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>")
|
||||
assert f.contains("<password>molecule_password</password>")
|
||||
|
||||
assert f.contains("<pool-min-size>1111</pool-min-size>")
|
||||
assert f.contains("<pool-max-size>1111</pool-max-size>")
|
||||
assert f.contains("<pool-min-idle>1111</pool-min-idle>")
|
||||
assert f.contains("<pool-max-idle>1111</pool-max-idle>")
|
||||
|
||||
assert f.contains("<pool-max-wait>1111</pool-max-wait>")
|
||||
assert f.contains("<min-evictable-idle-time-millis>1111</min-evictable-idle-time-millis>")
|
||||
assert f.contains("<pool-remove-abandoned>false</pool-remove-abandoned>")
|
||||
assert f.contains("<time-between-eviction-runs-millis>1111</time-between-eviction-runs-millis>")
|
||||
assert f.contains("<min-evictable-idle-time-millis>1111</min-evictable-idle-time-millis>")
|
||||
assert f.contains("<pool-remove-abandoned>false</pool-remove-abandoned>")
|
||||
assert f.contains("<pool-remove-abandoned-timeout>1111</pool-remove-abandoned-timeout>")
|
||||
assert f.contains("<pool-test-while-idle>false</pool-test-while-idle>")
|
||||
assert f.contains("<pool-test-on-borrow>true</pool-test-on-borrow>")
|
||||
|
||||
|
||||
def test_setenv_file(host):
|
||||
f = host.file('/opt/atlassian/jira-software/current/bin/setenv.sh')
|
||||
@@ -29,6 +45,7 @@ def test_cluster_file(host):
|
||||
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
|
||||
@@ -47,6 +64,7 @@ def test_server_file(host):
|
||||
assert not f.contains('proxyName=')
|
||||
assert not f.contains('proxyPort=')
|
||||
|
||||
|
||||
def test_install_permissions(host):
|
||||
assert host.file('/opt/atlassian/jira-software/current/conf/server.xml').user == 'root'
|
||||
assert host.file('/opt/atlassian/jira-software/current/atlassian-jira/WEB-INF/web.xml').user == 'root'
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
<pool-min-idle>{{ atl_db_minidle }}</pool-min-idle>
|
||||
<pool-max-idle>{{ atl_db_maxidle }}</pool-max-idle>
|
||||
|
||||
<pool-max-wait>30000</pool-max-wait>
|
||||
<pool-max-wait>{{ atl_db_maxwaitmillis }}</pool-max-wait>
|
||||
<validation-query>select 1</validation-query>
|
||||
<time-between-eviction-runs-millis>30000</time-between-eviction-runs-millis>
|
||||
<min-evictable-idle-time-millis>5000</min-evictable-idle-time-millis>
|
||||
<pool-remove-abandoned>true</pool-remove-abandoned>
|
||||
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
|
||||
<pool-test-while-idle>true</pool-test-while-idle>
|
||||
<pool-test-on-borrow>false</pool-test-on-borrow>
|
||||
<time-between-eviction-runs-millis>{{ atl_db_timebetweenevictionrunsmillis }}</time-between-eviction-runs-millis>
|
||||
<min-evictable-idle-time-millis>{{ atl_db_minevictableidletimemillis }}</min-evictable-idle-time-millis>
|
||||
<pool-remove-abandoned>{{ atl_db_removeabandoned }}</pool-remove-abandoned>
|
||||
<pool-remove-abandoned-timeout>{{ atl_db_removeabandonedtimeout }}</pool-remove-abandoned-timeout>
|
||||
<pool-test-while-idle>{{ atl_db_testwhileidle }}</pool-test-while-idle>
|
||||
<pool-test-on-borrow>{{ atl_db_testonborrow }}</pool-test-on-borrow>
|
||||
</jdbc-datasource>
|
||||
</jira-database-config>
|
||||
|
||||
Reference in New Issue
Block a user