mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -06:00
DCD-621: Uses ATL_DB_ENGINE paramerter to infer database type. If db_engine is 'aurora_postgres', then use aurrora postgres db type. Else use default postgres db_type
This commit is contained in:
14
roles/jira_config/molecule/aurora/Dockerfile.j2
Normal file
14
roles/jira_config/molecule/aurora/Dockerfile.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
# Molecule managed
|
||||
|
||||
{% if item.registry is defined %}
|
||||
FROM {{ item.registry.url }}/{{ item.image }}
|
||||
{% else %}
|
||||
FROM {{ item.image }}
|
||||
{% endif %}
|
||||
|
||||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
|
||||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
|
||||
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
|
||||
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
|
||||
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
|
||||
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
|
||||
36
roles/jira_config/molecule/aurora/molecule.yml
Normal file
36
roles/jira_config/molecule/aurora/molecule.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: amazon_linux2
|
||||
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:
|
||||
skip-tags: runtime_pkg
|
||||
lint:
|
||||
name: ansible-lint
|
||||
options:
|
||||
x: ["701"]
|
||||
inventory:
|
||||
links:
|
||||
group_vars: ../../../../group_vars/
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
||||
enabled: false
|
||||
32
roles/jira_config/molecule/aurora/playbook.yml
Normal file
32
roles/jira_config/molecule/aurora/playbook.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
atl_product_family: "jira"
|
||||
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'
|
||||
atl_db_engine: 'aurora_postgres'
|
||||
|
||||
roles:
|
||||
- role: linux_common
|
||||
- role: product_common
|
||||
- role: product_install
|
||||
- role: jira_config
|
||||
75
roles/jira_config/molecule/aurora/tests/test_default.py
Normal file
75
roles/jira_config/molecule/aurora/tests/test_default.py
Normal file
@@ -0,0 +1,75 @@
|
||||
import os
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
|
||||
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("<database-type>postgresaurora96</database-type>")
|
||||
assert f.contains("<driver-class>org.postgresql.Driver</driver-class>")
|
||||
assert f.contains("<username>atljira</username>")
|
||||
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')
|
||||
assert f.exists
|
||||
assert f.contains('^JVM_MINIMUM_MEMORY="PLACEHOLDER"')
|
||||
assert f.contains('^JVM_MAXIMUM_MEMORY="PLACEHOLDER"')
|
||||
assert f.contains('^JIRA_HOME="/var/atlassian/application-data/jira"')
|
||||
assert f.contains('^export CATALINA_OPTS="')
|
||||
|
||||
|
||||
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_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 f.contains('<Context path=""')
|
||||
assert f.contains('maxThreads="200"')
|
||||
assert f.contains('minSpareThreads="10"')
|
||||
assert f.contains('connectionTimeout="20000"')
|
||||
assert f.contains('enableLookups="false"')
|
||||
assert f.contains('protocol="HTTP/1.1"')
|
||||
assert f.contains('redirectPort=""')
|
||||
assert f.contains('acceptCount="10"')
|
||||
assert f.contains('secure="false"')
|
||||
assert f.contains('scheme="http"')
|
||||
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'
|
||||
|
||||
assert host.file('/opt/atlassian/jira-software/current/logs/').user == 'jira'
|
||||
assert host.file('/opt/atlassian/jira-software/current/work/').user == 'jira'
|
||||
assert host.file('/opt/atlassian/jira-software/current/temp/').user == 'jira'
|
||||
Reference in New Issue
Block a user