DCD-224: Rework of ServiceDesk handling to deal with more corner-cases, and limit it to the product_download role.

This commit is contained in:
Steve Smith
2019-05-06 17:21:56 +10:00
parent 4a429df39a
commit b9ac693d14
27 changed files with 299 additions and 286 deletions

View File

@@ -4,7 +4,6 @@
vars:
atl_product_family: "jira"
atl_product_edition: "jira-software"
atl_product_bundle: "software"
atl_product_user: "jira"
atl_product_version: "7.13.2"
atl_jdbc_user: 'atljira'

View File

@@ -1,14 +0,0 @@
# 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

@@ -1,30 +0,0 @@
---
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:
skip-tags: runtime_pkg
lint:
name: ansible-lint
inventory:
links:
group_vars: ../../../../group_vars/
verifier:
name: testinfra
lint:
name: flake8
enabled: false

View File

@@ -1,26 +0,0 @@
---
- name: Converge
hosts: all
vars:
atl_product_bundle: servicedesk
bundle_map:
all: software
servicedesk: software
core: core
software: software
atl_product_edition: "jira-{{ bundle_map[atl_product_bundle] }}"
atl_product_family: "jira"
atl_product_user: "jira"
atl_product_version: "7.13.3"
atl_jdbc_user: 'atljira'
atl_jvm_heap: 'PLACEHOLDER'
atl_cluster_node_id: 'FAKEID'
roles:
- role: linux_common
- role: product_common
- role: product_download
- role: jira_config

View File

@@ -1,37 +0,0 @@
import os
import urllib.request
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_version_is_correct(host):
verfile = host.file('/media/atl/jira/shared/jira-software.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == "7.13.3"
def test_is_downloaded(host):
installer = host.file('/opt/atlassian/tmp/jira-software.7.13.3.tar.gz')
assert installer.exists
assert installer.user == 'root'
def test_is_unpacked(host):
installer = host.file('/opt/atlassian/jira-software/7.13.3')
assert installer.exists
assert installer.is_directory
assert installer.user == 'jira'
assert installer.mode == 0o0755
def test_sd_is_downloaded(host):
installer = host.file('/opt/atlassian/tmp/jira-servicedesk-3.16.3.obr')
assert installer.exists
assert installer.user == 'root'
def test_is_unpacked(host):
installer = host.file('/media/atl/jira/shared/plugins/installed-plugins/jira-servicedesk-application-3.16.3.jar')
assert installer.exists
assert installer.user == 'jira'
assert installer.mode == 0o0750

View File

@@ -1,14 +0,0 @@
# 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

@@ -1,30 +0,0 @@
---
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:
skip-tags: runtime_pkg
lint:
name: ansible-lint
inventory:
links:
group_vars: ../../../../group_vars/
verifier:
name: testinfra
lint:
name: flake8
enabled: false

View File

@@ -1,26 +0,0 @@
---
- name: Converge
hosts: all
vars:
atl_product_bundle: servicedesk
bundle_map:
all: software
servicedesk: software
core: core
software: software
atl_product_edition: "jira-{{ bundle_map[atl_product_bundle] }}"
atl_product_family: "jira"
atl_product_user: "jira"
atl_product_version: "latest"
atl_jdbc_user: 'atljira'
atl_jvm_heap: 'PLACEHOLDER'
atl_cluster_node_id: 'FAKEID'
roles:
- role: linux_common
- role: product_common
- role: product_download
- role: jira_config

View File

@@ -1,37 +0,0 @@
import os
import urllib.request
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_version_is_correct(host):
verfile = host.file('/media/atl/jira/shared/jira-software.version')
assert verfile.exists
assert verfile.content.decode("UTF-8").strip() == "8.1.0"
def test_is_downloaded(host):
installer = host.file('/opt/atlassian/tmp/jira-software.8.1.0.tar.gz')
assert installer.exists
assert installer.user == 'root'
def test_is_unpacked(host):
installer = host.file('/opt/atlassian/jira-software/8.1.0')
assert installer.exists
assert installer.is_directory
assert installer.user == 'jira'
assert installer.mode == 0o0755
def test_sd_is_downloaded(host):
installer = host.file('/opt/atlassian/tmp/jira-servicedesk-4.1.0.obr')
assert installer.exists
assert installer.user == 'root'
def test_is_unpacked(host):
installer = host.file('/media/atl/jira/shared/plugins/installed-plugins/jira-servicedesk-application-4.1.0.jar')
assert installer.exists
assert installer.user == 'jira'
assert installer.mode == 0o0750