DCD-224: Rename some roles for clarity.

This commit is contained in:
Steve Smith
2019-05-09 08:37:52 +10:00
parent cf39532c18
commit 80247f1803
57 changed files with 13 additions and 13 deletions

View 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

View File

@@ -0,0 +1,31 @@
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: amazon_linux2
image: amazonlinux:2
groups:
- aws_node_local
- name: ubuntu_lts
image: ubuntu:bionic
groups:
- aws_node_local
provisioner:
name: ansible
options:
vv: true
skip-tags: runtime_pkg
lint:
name: ansible-lint
inventory:
links:
group_vars: ../../../../group_vars/
verifier:
name: testinfra
lint:
name: flake8
enabled: false

View File

@@ -0,0 +1,13 @@
---
- name: Converge
hosts: all
vars:
atl_product_edition: "jira-servicedesk"
atl_product_family: "jira"
atl_product_user: "jira"
atl_product_version: "latest"
roles:
- role: linux_common
- role: product_common
- role: product_install

View File

@@ -0,0 +1,39 @@
import os
import json
import urllib.request
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def get_latest():
data = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest")
meta = json.loads(data.read().decode("UTF-8"))
servicedesk = meta['name']
jira = meta['compatibilities'][0]['hosting']['server']['max']['version']
return (servicedesk, jira)
(sd, jira) = get_latest()
def test_version_is_correct(host):
verfile = host.file('/media/atl/jira/shared/jira-servicedesk.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == sd
def test_is_downloaded(host):
installer = host.file('/opt/atlassian/tmp/servicedesk.'+sd+'.bin')
assert installer.exists
assert installer.user == 'root'
def test_is_unpacked(host):
installer = host.file('/opt/atlassian/jira-servicedesk/'+sd)
assert installer.exists
assert installer.is_directory
assert installer.user == 'jira'
def test_plugin_is_present(host):
installer = host.file('/opt/atlassian/jira-servicedesk/current/atlassian-jira/WEB-INF/application-installation/jira-servicedesk-application/jira-servicedesk-application-'+sd+'.jar')
assert installer.exists
assert installer.user == 'jira'