mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-17 02:13:06 -06:00
AZURE-210 Deploy Crowd DC to Azure
This commit is contained in:
12
roles/az_common/.yamllint
Normal file
12
roles/az_common/.yamllint
Normal file
@@ -0,0 +1,12 @@
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
braces:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
brackets:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
line-length: disable
|
||||
truthy: disable
|
||||
trailing-spaces: false
|
||||
7
roles/az_common/defaults/main.yml
Normal file
7
roles/az_common/defaults/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# Values taken from https://docs.microsoft.com/en-us/sql/connect/jdbc/connecting-to-an-azure-sql-database
|
||||
# Windows values are milliseconds, Linux values are seconds
|
||||
sysctl_config:
|
||||
net.ipv4.tcp_keepalive_time: 30
|
||||
net.ipv4.tcp_keepalive_intvl: 1
|
||||
net.ipv6.tcp_keepalive_probes: 10
|
||||
1
roles/az_common/handlers/main.yml
Normal file
1
roles/az_common/handlers/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
---
|
||||
14
roles/az_common/molecule/default/Dockerfile.j2
Normal file
14
roles/az_common/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
|
||||
28
roles/az_common/molecule/default/molecule.yml
Normal file
28
roles/az_common/molecule/default/molecule.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: ubuntu_lts
|
||||
image: ubuntu:bionic
|
||||
groups:
|
||||
- az_node_local
|
||||
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
|
||||
23
roles/az_common/molecule/default/playbook.yml
Normal file
23
roles/az_common/molecule/default/playbook.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
atl_product_family: "confluence"
|
||||
atl_product_edition: "confluence"
|
||||
atl_product_user: "confluence"
|
||||
atl_product_version: "latest"
|
||||
atl_db_engine: "postgres"
|
||||
atl_db_host: "postgres-db.ap-southeast-2.rds.amazonaws.com"
|
||||
atl_jdbc_db_name: "confluence"
|
||||
atl_jdbc_user: 'confluence'
|
||||
atl_jdbc_password: 'molecule_password'
|
||||
atl_jvm_heap: 'PLACEHOLDER'
|
||||
atl_cluster_node_id: 'FAKEID'
|
||||
atl_autologin_cookie_age: "COOKIEAGE"
|
||||
atl_local_ipv4: "1.1.1.1"
|
||||
atl_tomcat_scheme: "http"
|
||||
atl_proxy_name: "localhost"
|
||||
atl_proxy_port: "80"
|
||||
|
||||
roles:
|
||||
- role: az_common
|
||||
16
roles/az_common/molecule/default/tests/test_default.py
Normal file
16
roles/az_common/molecule/default/tests/test_default.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
import pytest
|
||||
|
||||
import testinfra.utils.ansible_runner
|
||||
|
||||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
|
||||
|
||||
@pytest.mark.parametrize('pkg', [
|
||||
'netcat',
|
||||
'rsync',
|
||||
'cifs-utils'
|
||||
])
|
||||
def test_pkg(host, pkg):
|
||||
package = host.package(pkg)
|
||||
assert package.is_installed
|
||||
33
roles/az_common/tasks/main.yml
Normal file
33
roles/az_common/tasks/main.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
|
||||
- name: Install additional support packages
|
||||
package:
|
||||
name:
|
||||
- netcat
|
||||
- rsync
|
||||
- cifs-utils
|
||||
|
||||
- name: Fetch VM ID
|
||||
command: "dmidecode -s system-uuid"
|
||||
register: az_vm_id
|
||||
tags:
|
||||
- runtime_pkg
|
||||
changed_when: true
|
||||
|
||||
- name: Use VM ID for cluster node ID
|
||||
set_fact:
|
||||
atl_cluster_node_id: "{{ az_vm_id.stdout }}"
|
||||
tags:
|
||||
- runtime_pkg
|
||||
|
||||
- name: Tune TCP Keep Alive
|
||||
sysctl:
|
||||
name: '{{ item.key }}'
|
||||
value: '{{ item.value }}'
|
||||
reload: yes
|
||||
ignoreerrors: yes
|
||||
sysctl_file: /etc/sysctl.conf
|
||||
sysctl_set: yes
|
||||
with_dict: '{{ sysctl_config }}'
|
||||
tags:
|
||||
- runtime_pkg
|
||||
Reference in New Issue
Block a user