mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-17 02:13:06 -06:00
AZURE-211 Renamed az_* files to azure_*
This commit is contained in:
12
roles/azure_common/.yamllint
Normal file
12
roles/azure_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
|
||||
14
roles/azure_common/molecule/default/Dockerfile.j2
Normal file
14
roles/azure_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/azure_common/molecule/default/molecule.yml
Normal file
28
roles/azure_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:
|
||||
- azure_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/azure_common/molecule/default/playbook.yml
Normal file
23
roles/azure_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: azure_common
|
||||
17
roles/azure_common/molecule/default/tests/test_default.py
Normal file
17
roles/azure_common/molecule/default/tests/test_default.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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',
|
||||
'python-lxml'
|
||||
])
|
||||
def test_pkg(host, pkg):
|
||||
package = host.package(pkg)
|
||||
assert package.is_installed
|
||||
22
roles/azure_common/tasks/main.yml
Normal file
22
roles/azure_common/tasks/main.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
|
||||
- name: Install additional support packages
|
||||
package:
|
||||
name:
|
||||
- netcat
|
||||
- rsync
|
||||
- cifs-utils
|
||||
- python-lxml
|
||||
|
||||
- name: Fetch VM ID
|
||||
command: "dmidecode -s system-uuid"
|
||||
register: azure_vm_id
|
||||
tags:
|
||||
- runtime_pkg
|
||||
changed_when: true
|
||||
|
||||
- name: Use VM ID for cluster node ID
|
||||
set_fact:
|
||||
atl_cluster_node_id: "{{ azure_vm_id.stdout }}"
|
||||
tags:
|
||||
- runtime_pkg
|
||||
Reference in New Issue
Block a user