mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-224: Start of Jira preconfiguration. Just dbconfig.xml for now.
This commit is contained in:
@@ -25,3 +25,16 @@ atl_installer_temp: "{{ atl_installation_base }}/tmp"
|
|||||||
# set in /etc/atl by the CloudFormation template and sourced before
|
# set in /etc/atl by the CloudFormation template and sourced before
|
||||||
# Ansible is run. See bin/ansible-with-atl-env for a convenient wrapper
|
# Ansible is run. See bin/ansible-with-atl-env for a convenient wrapper
|
||||||
atl_efs_id: "{{ lookup('env', 'ATL_EFS_ID') }}"
|
atl_efs_id: "{{ lookup('env', 'ATL_EFS_ID') }}"
|
||||||
|
|
||||||
|
atl_jdbc_url: "{{ lookup('env', 'ATL_JDBC_URL') }}"
|
||||||
|
atl_jdbc_user: "{{ lookup('env', 'ATL_JDBC_USER') }}"
|
||||||
|
atl_jdbc_password: "{{ lookup('env', 'ATL_JDBC_PASSWORD') }}"
|
||||||
|
|
||||||
|
atl_jdbc_driver: "{{ lookup('env', 'ATL_JDBC_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_jvm_heap: "{{ lookup('env', 'ATL_JVM_HEAP) }}"
|
||||||
|
atl_catalina_opts: "{{ lookup('env', 'ATL_CATALINA_OPTS) }}"
|
||||||
|
|||||||
11
roles/jira_config/.yamllint
Normal file
11
roles/jira_config/.yamllint
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
braces:
|
||||||
|
max-spaces-inside: 1
|
||||||
|
level: error
|
||||||
|
brackets:
|
||||||
|
max-spaces-inside: 1
|
||||||
|
level: error
|
||||||
|
line-length: disable
|
||||||
|
truthy: disable
|
||||||
14
roles/jira_config/molecule/default/Dockerfile.j2
Normal file
14
roles/jira_config/molecule/default/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
|
||||||
24
roles/jira_config/molecule/default/molecule.yml
Normal file
24
roles/jira_config/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
dependency:
|
||||||
|
name: galaxy
|
||||||
|
driver:
|
||||||
|
name: docker
|
||||||
|
lint:
|
||||||
|
name: yamllint
|
||||||
|
platforms:
|
||||||
|
- name: amazon_linux2
|
||||||
|
image: amazonlinux:2
|
||||||
|
- name: ubuntu_lts
|
||||||
|
image: ubuntu:bionic
|
||||||
|
provisioner:
|
||||||
|
name: ansible
|
||||||
|
lint:
|
||||||
|
name: ansible-lint
|
||||||
|
inventory:
|
||||||
|
links:
|
||||||
|
group_vars: ../../../../group_vars/
|
||||||
|
verifier:
|
||||||
|
name: testinfra
|
||||||
|
lint:
|
||||||
|
name: flake8
|
||||||
|
enabled: false
|
||||||
14
roles/jira_config/molecule/default/playbook.yml
Normal file
14
roles/jira_config/molecule/default/playbook.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
- name: Converge
|
||||||
|
hosts: all
|
||||||
|
vars:
|
||||||
|
atl_product_family: "jira"
|
||||||
|
atl_product_edition: "jira-software"
|
||||||
|
atl_product_user: "jira"
|
||||||
|
atl_product_version: "7.13.2"
|
||||||
|
atl_jdbc_user: 'atljira'
|
||||||
|
roles:
|
||||||
|
- role: linux_common
|
||||||
|
- role: product_common
|
||||||
|
- role: jira_download
|
||||||
|
- role: jira_config
|
||||||
15
roles/jira_config/molecule/default/tests/test_default.py
Normal file
15
roles/jira_config/molecule/default/tests/test_default.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||||
|
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||||
|
|
||||||
|
|
||||||
|
def test_hosts_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>")
|
||||||
7
roles/jira_config/tasks/main.yml
Normal file
7
roles/jira_config/tasks/main.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Create dbconfig.xml
|
||||||
|
template:
|
||||||
|
src: dbconfig.xml.j2
|
||||||
|
dest: "{{ atl_product_home }}/dbconfig.xml"
|
||||||
|
owner: "{{ atl_product_user }}"
|
||||||
28
roles/jira_config/templates/dbconfig.xml.j2
Normal file
28
roles/jira_config/templates/dbconfig.xml.j2
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<jira-database-config>
|
||||||
|
<name>defaultDS</name>
|
||||||
|
<delegator-name>default</delegator-name>
|
||||||
|
<database-type>postgres72</database-type>
|
||||||
|
<schema-name>public</schema-name>
|
||||||
|
<jdbc-datasource>
|
||||||
|
<url>{{ atl_jdbc_url }}</url>
|
||||||
|
<driver-class>{{ atl_jdbc_driver }}</driver-class>
|
||||||
|
<username>{{ atl_jdbc_user }}</username>
|
||||||
|
<password>{{ atl_jdbc_password }}</password>
|
||||||
|
|
||||||
|
<pool-min-size>{{ atl_db_poolminsize }}</pool-min-size>
|
||||||
|
<pool-max-size>{{ atl_db_poolmaxsize }}</pool-max-size>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</jdbc-datasource>
|
||||||
|
</jira-database-config>
|
||||||
Reference in New Issue
Block a user