From cf39532c187cc7d85a744ff57c7750986ea11058 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Thu, 9 May 2019 08:31:07 +1000 Subject: [PATCH] DCD-224: Remove old TGZ installer. --- roles/tgz_download/.yamllint | 12 ---- roles/tgz_download/defaults/main.yml | 21 ------ .../molecule/bitbucket_latest/Dockerfile.j2 | 14 ---- .../molecule/bitbucket_latest/molecule.yml | 30 -------- .../molecule/bitbucket_latest/playbook.yml | 11 --- .../bitbucket_latest/tests/#test_default.py# | 43 ----------- .../bitbucket_latest/tests/test_default.py | 40 ----------- .../molecule/confluence_latest/Dockerfile.j2 | 14 ---- .../molecule/confluence_latest/molecule.yml | 30 -------- .../molecule/confluence_latest/playbook.yml | 11 --- .../confluence_latest/tests/test_default.py | 40 ----------- .../molecule/default/Dockerfile.j2 | 14 ---- .../molecule/default/molecule.yml | 32 --------- .../molecule/default/playbook.yml | 11 --- .../molecule/default/tests/test_default.py | 25 ------- .../jira_version_from_file/Dockerfile.j2 | 14 ---- .../jira_version_from_file/molecule.yml | 32 --------- .../jira_version_from_file/playbook.yml | 24 ------- .../tests/test_default.py | 26 ------- .../jira_version_latest/Dockerfile.j2 | 14 ---- .../molecule/jira_version_latest/molecule.yml | 32 --------- .../molecule/jira_version_latest/playbook.yml | 12 ---- .../jira_version_latest/tests/test_default.py | 25 ------- .../jira_version_override/Dockerfile.j2 | 14 ---- .../jira_version_override/molecule.yml | 32 --------- .../jira_version_override/playbook.yml | 12 ---- .../tests/test_default.py | 26 ------- .../molecule/resources/tests/test_common.py | 21 ------ .../molecule/servicedesk3/Dockerfile.j2 | 14 ---- .../molecule/servicedesk3/molecule.yml | 31 -------- .../molecule/servicedesk3/playbook.yml | 13 ---- .../servicedesk3/tests/test_default.py | 37 ---------- .../molecule/servicedesk4/Dockerfile.j2 | 14 ---- .../molecule/servicedesk4/molecule.yml | 31 -------- .../molecule/servicedesk4/playbook.yml | 13 ---- .../servicedesk4/tests/test_default.py | 37 ---------- .../molecule/servicedesk_latest/Dockerfile.j2 | 14 ---- .../molecule/servicedesk_latest/molecule.yml | 31 -------- .../molecule/servicedesk_latest/playbook.yml | 13 ---- .../servicedesk_latest/tests/test_default.py | 46 ------------ .../tasks/cached_version_fetch.yml | 21 ------ .../tasks/cached_version_write.yml | 8 --- roles/tgz_download/tasks/fetch_product.yml | 38 ---------- roles/tgz_download/tasks/main.yml | 13 ---- roles/tgz_download/tasks/product_download.yml | 31 -------- .../tasks/servicedesk_download.yml | 71 ------------------- roles/tgz_download/templates/version.j2 | 1 - 47 files changed, 1109 deletions(-) delete mode 100644 roles/tgz_download/.yamllint delete mode 100644 roles/tgz_download/defaults/main.yml delete mode 100644 roles/tgz_download/molecule/bitbucket_latest/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/bitbucket_latest/molecule.yml delete mode 100644 roles/tgz_download/molecule/bitbucket_latest/playbook.yml delete mode 100644 roles/tgz_download/molecule/bitbucket_latest/tests/#test_default.py# delete mode 100644 roles/tgz_download/molecule/bitbucket_latest/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/confluence_latest/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/confluence_latest/molecule.yml delete mode 100644 roles/tgz_download/molecule/confluence_latest/playbook.yml delete mode 100644 roles/tgz_download/molecule/confluence_latest/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/default/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/default/molecule.yml delete mode 100644 roles/tgz_download/molecule/default/playbook.yml delete mode 100644 roles/tgz_download/molecule/default/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/jira_version_from_file/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/jira_version_from_file/molecule.yml delete mode 100644 roles/tgz_download/molecule/jira_version_from_file/playbook.yml delete mode 100644 roles/tgz_download/molecule/jira_version_from_file/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/jira_version_latest/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/jira_version_latest/molecule.yml delete mode 100644 roles/tgz_download/molecule/jira_version_latest/playbook.yml delete mode 100644 roles/tgz_download/molecule/jira_version_latest/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/jira_version_override/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/jira_version_override/molecule.yml delete mode 100644 roles/tgz_download/molecule/jira_version_override/playbook.yml delete mode 100644 roles/tgz_download/molecule/jira_version_override/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/resources/tests/test_common.py delete mode 100644 roles/tgz_download/molecule/servicedesk3/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/servicedesk3/molecule.yml delete mode 100644 roles/tgz_download/molecule/servicedesk3/playbook.yml delete mode 100644 roles/tgz_download/molecule/servicedesk3/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/servicedesk4/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/servicedesk4/molecule.yml delete mode 100644 roles/tgz_download/molecule/servicedesk4/playbook.yml delete mode 100644 roles/tgz_download/molecule/servicedesk4/tests/test_default.py delete mode 100644 roles/tgz_download/molecule/servicedesk_latest/Dockerfile.j2 delete mode 100644 roles/tgz_download/molecule/servicedesk_latest/molecule.yml delete mode 100644 roles/tgz_download/molecule/servicedesk_latest/playbook.yml delete mode 100644 roles/tgz_download/molecule/servicedesk_latest/tests/test_default.py delete mode 100644 roles/tgz_download/tasks/cached_version_fetch.yml delete mode 100644 roles/tgz_download/tasks/cached_version_write.yml delete mode 100644 roles/tgz_download/tasks/fetch_product.yml delete mode 100644 roles/tgz_download/tasks/main.yml delete mode 100644 roles/tgz_download/tasks/product_download.yml delete mode 100644 roles/tgz_download/tasks/servicedesk_download.yml delete mode 100644 roles/tgz_download/templates/version.j2 diff --git a/roles/tgz_download/.yamllint b/roles/tgz_download/.yamllint deleted file mode 100644 index a87f8ff..0000000 --- a/roles/tgz_download/.yamllint +++ /dev/null @@ -1,12 +0,0 @@ -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 diff --git a/roles/tgz_download/defaults/main.yml b/roles/tgz_download/defaults/main.yml deleted file mode 100644 index 262efa3..0000000 --- a/roles/tgz_download/defaults/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- - -atl_product_latest_version_url: "https://marketplace.atlassian.com/rest/2/applications/{{ atl_product_family }}/versions/latest" -atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition }}.version" - -atl_release_base_url: "https://product-downloads.atlassian.com/software" -atl_product_base_url: "{{ atl_release_base_url }}/{{ atl_product_family }}/downloads" -atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_download_version | default(atl_product_version) }}.tar.gz" - -atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_download_version | default(atl_product_version) }}.tar.gz" -atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" - -atl_marketplace_base: "https://marketplace.atlassian.com" -atl_servicedesk_latest_url: "https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest" -atl_servicedesk_versioned_url: "https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/name/{{ atl_product_version }}" -atl_servicedesk_url_map: - latest: "{{ atl_servicedesk_latest_url }}" - default: "{{ atl_servicedesk_versioned_url }}" -atl_servicedesk_metadata_url: "{{ atl_servicedesk_url_map[atl_product_version] | default(atl_servicedesk_url_map['default']) }}" - -atl_servicedesk_download_file: "{{ atl_installer_temp }}/jira-servicedesk.{{ atl_product_version }}.obr" diff --git a/roles/tgz_download/molecule/bitbucket_latest/Dockerfile.j2 b/roles/tgz_download/molecule/bitbucket_latest/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/bitbucket_latest/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/bitbucket_latest/molecule.yml b/roles/tgz_download/molecule/bitbucket_latest/molecule.yml deleted file mode 100644 index 7fd3163..0000000 --- a/roles/tgz_download/molecule/bitbucket_latest/molecule.yml +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/bitbucket_latest/playbook.yml b/roles/tgz_download/molecule/bitbucket_latest/playbook.yml deleted file mode 100644 index a521f2b..0000000 --- a/roles/tgz_download/molecule/bitbucket_latest/playbook.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_family: "stash" - atl_product_edition: "bitbucket" - atl_product_user: "bitbucket" - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/bitbucket_latest/tests/#test_default.py# b/roles/tgz_download/molecule/bitbucket_latest/tests/#test_default.py# deleted file mode 100644 index 0862a21..0000000 --- a/roles/tgz_download/molecule/bitbucket_latest/tests/#test_default.py# +++ /dev/null @@ -1,43 +0,0 @@ -import os -import urllib.request -import json - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - -def test_version_downloaded(host): - verfile = host.file('/media/atl/confluence/shared/confluence.version') - assert verfile.exists - -def test_symlink_created(host): - target = host.file('/opt/atlassian/confluence/current') - assert target.exists - assert target.is_symlink - -def test_unpacked(host): - verfile = host.file('/opt/atlassian/confluence/current/bin/catalina.sh') - assert verfile.exists - -def test_version_file_is_latest(host): - verfile = host.file('/media/atl/confluence/shared/confluence.version') - assert verfile.exists - - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest") - upstream_json = json.load(upstream_fd) - upstream = upstream_json['version'] - - assert verfile.content.decode("UTF-8").strip() == upstream.strip() - -def test_latest_is_downloaded(host): - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest") - upstream_json = json.load(upstream_fd) - upstream = upstream_json['version'] - - installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'.tar.gz') - assert installer.exists - assert installer.user == 'root' - -https://product-downloads.atlassian.com/software/bitbucket/downloads/atlassian-bitbucket-6.2.0.tar.gz -https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-6.2.0.tar.gz \ No newline at end of file diff --git a/roles/tgz_download/molecule/bitbucket_latest/tests/test_default.py b/roles/tgz_download/molecule/bitbucket_latest/tests/test_default.py deleted file mode 100644 index 164b088..0000000 --- a/roles/tgz_download/molecule/bitbucket_latest/tests/test_default.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import urllib.request -import json - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - -def test_version_downloaded(host): - verfile = host.file('/media/atl/stash/shared/bitbucket.version') - assert verfile.exists - -def test_symlink_created(host): - target = host.file('/opt/atlassian/bitbucket/current') - assert target.exists - assert target.is_symlink - -def test_unpacked(host): - verfile = host.file('/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh') - assert verfile.exists - -def test_version_file_is_latest(host): - verfile = host.file('/media/atl/stash/shared/bitbucket.version') - assert verfile.exists - - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") - upstream_json = json.load(upstream_fd) - upstream = upstream_json['version'] - - assert verfile.content.decode("UTF-8").strip() == upstream.strip() - -def test_latest_is_downloaded(host): - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") - upstream_json = json.load(upstream_fd) - upstream = upstream_json['version'] - - installer = host.file('/opt/atlassian/tmp/bitbucket.'+upstream+'.tar.gz') - assert installer.exists - assert installer.user == 'root' diff --git a/roles/tgz_download/molecule/confluence_latest/Dockerfile.j2 b/roles/tgz_download/molecule/confluence_latest/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/confluence_latest/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/confluence_latest/molecule.yml b/roles/tgz_download/molecule/confluence_latest/molecule.yml deleted file mode 100644 index 7fd3163..0000000 --- a/roles/tgz_download/molecule/confluence_latest/molecule.yml +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/confluence_latest/playbook.yml b/roles/tgz_download/molecule/confluence_latest/playbook.yml deleted file mode 100644 index 78e7bfc..0000000 --- a/roles/tgz_download/molecule/confluence_latest/playbook.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_family: "confluence" - atl_product_edition: "confluence" - atl_product_user: "confluence" - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/confluence_latest/tests/test_default.py b/roles/tgz_download/molecule/confluence_latest/tests/test_default.py deleted file mode 100644 index 0e8039a..0000000 --- a/roles/tgz_download/molecule/confluence_latest/tests/test_default.py +++ /dev/null @@ -1,40 +0,0 @@ -import os -import urllib.request -import json - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - -def test_version_downloaded(host): - verfile = host.file('/media/atl/confluence/shared/confluence.version') - assert verfile.exists - -def test_symlink_created(host): - target = host.file('/opt/atlassian/confluence/current') - assert target.exists - assert target.is_symlink - -def test_unpacked(host): - verfile = host.file('/opt/atlassian/confluence/current/bin/catalina.sh') - assert verfile.exists - -def test_version_file_is_latest(host): - verfile = host.file('/media/atl/confluence/shared/confluence.version') - assert verfile.exists - - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest") - upstream_json = json.load(upstream_fd) - upstream = upstream_json['version'] - - assert verfile.content.decode("UTF-8").strip() == upstream.strip() - -def test_latest_is_downloaded(host): - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/confluence/versions/latest") - upstream_json = json.load(upstream_fd) - upstream = upstream_json['version'] - - installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'.tar.gz') - assert installer.exists - assert installer.user == 'root' diff --git a/roles/tgz_download/molecule/default/Dockerfile.j2 b/roles/tgz_download/molecule/default/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/default/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/default/molecule.yml b/roles/tgz_download/molecule/default/molecule.yml deleted file mode 100644 index 46049f8..0000000 --- a/roles/tgz_download/molecule/default/molecule.yml +++ /dev/null @@ -1,32 +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 - additional_files_or_dirs: - - ../../resources/tests/test_*.py - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/default/playbook.yml b/roles/tgz_download/molecule/default/playbook.yml deleted file mode 100644 index 6cb7eaa..0000000 --- a/roles/tgz_download/molecule/default/playbook.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_family: "jira" - atl_product_edition: "jira-core" - atl_product_user: "jira" - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/default/tests/test_default.py b/roles/tgz_download/molecule/default/tests/test_default.py deleted file mode 100644 index bbbe06a..0000000 --- a/roles/tgz_download/molecule/default/tests/test_default.py +++ /dev/null @@ -1,25 +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_file_is_latest(host): - verfile = host.file('/media/atl/jira/shared/jira-core.version') - assert verfile.exists - - upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest") - upstream = upstream_fd.read() - - assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip() - -def test_latest_is_downloaded(host): - upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest") - upstream = upstream_fd.read().decode("UTF-8").strip() - - installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.tar.gz') - assert installer.exists - assert installer.user == 'root' diff --git a/roles/tgz_download/molecule/jira_version_from_file/Dockerfile.j2 b/roles/tgz_download/molecule/jira_version_from_file/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/jira_version_from_file/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/jira_version_from_file/molecule.yml b/roles/tgz_download/molecule/jira_version_from_file/molecule.yml deleted file mode 100644 index 46049f8..0000000 --- a/roles/tgz_download/molecule/jira_version_from_file/molecule.yml +++ /dev/null @@ -1,32 +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 - additional_files_or_dirs: - - ../../resources/tests/test_*.py - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/jira_version_from_file/playbook.yml b/roles/tgz_download/molecule/jira_version_from_file/playbook.yml deleted file mode 100644 index 63a1551..0000000 --- a/roles/tgz_download/molecule/jira_version_from_file/playbook.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_family: "jira" - atl_product_edition: "jira-core" - atl_product_user: "jira" - # NOTE: This should be ignored because the version file exists. - atl_product_version: "latest" - - pre_tasks: - - name: Create cache dir - file: - path: '/media/atl/jira/shared/' - state: directory - - name: Seed version - copy: - dest: '/media/atl/jira/shared/jira-core.version' - content: "7.9.0" - - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/jira_version_from_file/tests/test_default.py b/roles/tgz_download/molecule/jira_version_from_file/tests/test_default.py deleted file mode 100644 index 3c50aa3..0000000 --- a/roles/tgz_download/molecule/jira_version_from_file/tests/test_default.py +++ /dev/null @@ -1,26 +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-core.version') - assert verfile.exists - - assert verfile.content.decode("UTF-8").strip() == "7.9.0" - -def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/jira-core.7.9.0.tar.gz') - assert installer.exists - assert installer.user == 'root' - -def test_is_unpacked(host): - installer = host.file('/opt/atlassian/jira-core/7.9.0') - assert installer.exists - assert installer.is_directory - assert installer.user == 'jira' - assert installer.mode == 0o0755 diff --git a/roles/tgz_download/molecule/jira_version_latest/Dockerfile.j2 b/roles/tgz_download/molecule/jira_version_latest/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/jira_version_latest/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/jira_version_latest/molecule.yml b/roles/tgz_download/molecule/jira_version_latest/molecule.yml deleted file mode 100644 index 46049f8..0000000 --- a/roles/tgz_download/molecule/jira_version_latest/molecule.yml +++ /dev/null @@ -1,32 +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 - additional_files_or_dirs: - - ../../resources/tests/test_*.py - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/jira_version_latest/playbook.yml b/roles/tgz_download/molecule/jira_version_latest/playbook.yml deleted file mode 100644 index 2759a2c..0000000 --- a/roles/tgz_download/molecule/jira_version_latest/playbook.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_family: "jira" - atl_product_edition: "jira-core" - atl_product_user: "jira" - atl_product_version: "latest" - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/jira_version_latest/tests/test_default.py b/roles/tgz_download/molecule/jira_version_latest/tests/test_default.py deleted file mode 100644 index bbbe06a..0000000 --- a/roles/tgz_download/molecule/jira_version_latest/tests/test_default.py +++ /dev/null @@ -1,25 +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_file_is_latest(host): - verfile = host.file('/media/atl/jira/shared/jira-core.version') - assert verfile.exists - - upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest") - upstream = upstream_fd.read() - - assert verfile.content.decode("UTF-8").strip() == upstream.decode("UTF-8").strip() - -def test_latest_is_downloaded(host): - upstream_fd = urllib.request.urlopen("https://s3.amazonaws.com/atlassian-software/releases/jira-core/latest") - upstream = upstream_fd.read().decode("UTF-8").strip() - - installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.tar.gz') - assert installer.exists - assert installer.user == 'root' diff --git a/roles/tgz_download/molecule/jira_version_override/Dockerfile.j2 b/roles/tgz_download/molecule/jira_version_override/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/jira_version_override/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/jira_version_override/molecule.yml b/roles/tgz_download/molecule/jira_version_override/molecule.yml deleted file mode 100644 index 46049f8..0000000 --- a/roles/tgz_download/molecule/jira_version_override/molecule.yml +++ /dev/null @@ -1,32 +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 - additional_files_or_dirs: - - ../../resources/tests/test_*.py - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/jira_version_override/playbook.yml b/roles/tgz_download/molecule/jira_version_override/playbook.yml deleted file mode 100644 index a7e32d1..0000000 --- a/roles/tgz_download/molecule/jira_version_override/playbook.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_family: "jira" - atl_product_edition: "jira-core" - atl_product_user: "jira" - atl_product_version: "7.13.2" - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/jira_version_override/tests/test_default.py b/roles/tgz_download/molecule/jira_version_override/tests/test_default.py deleted file mode 100644 index 829aed3..0000000 --- a/roles/tgz_download/molecule/jira_version_override/tests/test_default.py +++ /dev/null @@ -1,26 +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-core.version') - assert verfile.exists - - assert verfile.content.decode("UTF-8").strip() == "7.13.2" - -def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/jira-core.7.13.2.tar.gz') - assert installer.exists - assert installer.user == 'root' - -def test_is_unpacked(host): - installer = host.file('/opt/atlassian/jira-core/7.13.2') - assert installer.exists - assert installer.is_directory - assert installer.user == 'jira' - assert installer.mode == 0o0755 diff --git a/roles/tgz_download/molecule/resources/tests/test_common.py b/roles/tgz_download/molecule/resources/tests/test_common.py deleted file mode 100644 index bb85871..0000000 --- a/roles/tgz_download/molecule/resources/tests/test_common.py +++ /dev/null @@ -1,21 +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_downloaded(host): - verfile = host.file('/media/atl/jira/shared/jira-core.version') - assert verfile.exists - -def test_symlink_created(host): - target = host.file('/opt/atlassian/jira-core/current') - assert target.exists - assert target.is_symlink - -def test_unpacked(host): - verfile = host.file('/opt/atlassian/jira-core/current/bin/catalina.sh') - assert verfile.exists diff --git a/roles/tgz_download/molecule/servicedesk3/Dockerfile.j2 b/roles/tgz_download/molecule/servicedesk3/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/servicedesk3/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/servicedesk3/molecule.yml b/roles/tgz_download/molecule/servicedesk3/molecule.yml deleted file mode 100644 index 52ea9de..0000000 --- a/roles/tgz_download/molecule/servicedesk3/molecule.yml +++ /dev/null @@ -1,31 +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: - vv: true - skip-tags: runtime_pkg - lint: - name: ansible-lint - inventory: - links: - group_vars: ../../../../group_vars/ -verifier: - name: testinfra - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/servicedesk3/playbook.yml b/roles/tgz_download/molecule/servicedesk3/playbook.yml deleted file mode 100644 index 189cb83..0000000 --- a/roles/tgz_download/molecule/servicedesk3/playbook.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_edition: "jira-servicedesk" - atl_product_family: "jira" - atl_product_user: "jira" - atl_product_version: "3.0.2" - - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/servicedesk3/tests/test_default.py b/roles/tgz_download/molecule/servicedesk3/tests/test_default.py deleted file mode 100644 index 280bdee..0000000 --- a/roles/tgz_download/molecule/servicedesk3/tests/test_default.py +++ /dev/null @@ -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-servicedesk.version') - assert verfile.exists - - assert verfile.content.decode("UTF-8").strip() == "3.0.2" - -def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/jira-software.7.0.11.tar.gz') - assert installer.exists - assert installer.user == 'root' - -def test_is_unpacked(host): - installer = host.file('/opt/atlassian/jira-servicedesk/3.0.2') - 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.0.2.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.0.2.jar') - assert installer.exists - assert installer.user == 'jira' - assert installer.mode == 0o0750 diff --git a/roles/tgz_download/molecule/servicedesk4/Dockerfile.j2 b/roles/tgz_download/molecule/servicedesk4/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/servicedesk4/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/servicedesk4/molecule.yml b/roles/tgz_download/molecule/servicedesk4/molecule.yml deleted file mode 100644 index 52ea9de..0000000 --- a/roles/tgz_download/molecule/servicedesk4/molecule.yml +++ /dev/null @@ -1,31 +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: - vv: true - skip-tags: runtime_pkg - lint: - name: ansible-lint - inventory: - links: - group_vars: ../../../../group_vars/ -verifier: - name: testinfra - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/servicedesk4/playbook.yml b/roles/tgz_download/molecule/servicedesk4/playbook.yml deleted file mode 100644 index 17be66c..0000000 --- a/roles/tgz_download/molecule/servicedesk4/playbook.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Converge - hosts: all - vars: - atl_product_edition: "jira-servicedesk" - atl_product_family: "jira" - atl_product_user: "jira" - atl_product_version: "4.1.0" - - roles: - - role: linux_common - - role: product_common - - role: tgz_download diff --git a/roles/tgz_download/molecule/servicedesk4/tests/test_default.py b/roles/tgz_download/molecule/servicedesk4/tests/test_default.py deleted file mode 100644 index 4b86875..0000000 --- a/roles/tgz_download/molecule/servicedesk4/tests/test_default.py +++ /dev/null @@ -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-servicedesk.version') - assert verfile.exists - - assert verfile.content.decode("UTF-8").strip() == "4.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-servicedesk/4.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 diff --git a/roles/tgz_download/molecule/servicedesk_latest/Dockerfile.j2 b/roles/tgz_download/molecule/servicedesk_latest/Dockerfile.j2 deleted file mode 100644 index e6aa95d..0000000 --- a/roles/tgz_download/molecule/servicedesk_latest/Dockerfile.j2 +++ /dev/null @@ -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 diff --git a/roles/tgz_download/molecule/servicedesk_latest/molecule.yml b/roles/tgz_download/molecule/servicedesk_latest/molecule.yml deleted file mode 100644 index 52ea9de..0000000 --- a/roles/tgz_download/molecule/servicedesk_latest/molecule.yml +++ /dev/null @@ -1,31 +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: - vv: true - skip-tags: runtime_pkg - lint: - name: ansible-lint - inventory: - links: - group_vars: ../../../../group_vars/ -verifier: - name: testinfra - lint: - name: flake8 - enabled: false diff --git a/roles/tgz_download/molecule/servicedesk_latest/playbook.yml b/roles/tgz_download/molecule/servicedesk_latest/playbook.yml deleted file mode 100644 index 15d1f61..0000000 --- a/roles/tgz_download/molecule/servicedesk_latest/playbook.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- 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: tgz_download diff --git a/roles/tgz_download/molecule/servicedesk_latest/tests/test_default.py b/roles/tgz_download/molecule/servicedesk_latest/tests/test_default.py deleted file mode 100644 index 6ff8e80..0000000 --- a/roles/tgz_download/molecule/servicedesk_latest/tests/test_default.py +++ /dev/null @@ -1,46 +0,0 @@ -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/jira-software.'+jira+'.tar.gz') - assert installer.exists - assert installer.user == 'root' - -def test_is_unpacked(host): - installer = host.file('/opt/atlassian/jira-servicedesk/'+jira) - 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.'+sd+'.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-'+sd+'.jar') - assert installer.exists - assert installer.user == 'jira' - assert installer.mode == 0o0750 diff --git a/roles/tgz_download/tasks/cached_version_fetch.yml b/roles/tgz_download/tasks/cached_version_fetch.yml deleted file mode 100644 index 2df9c98..0000000 --- a/roles/tgz_download/tasks/cached_version_fetch.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- - -- name: Check for existing version cache file - stat: - path: "{{ atl_product_version_cache }}" - register: cached - -# Case: File exists, always use its value -- name: Use version for product version - block: - - - name: Read cached version from file - command: "cat {{ atl_product_version_cache }}" - register: atl_product_version_file - changed_when: false - - - name: Set the local var to cached version - set_fact: - atl_product_version: "{{ atl_product_version_file.stdout }}" - - when: cached.stat.exists diff --git a/roles/tgz_download/tasks/cached_version_write.yml b/roles/tgz_download/tasks/cached_version_write.yml deleted file mode 100644 index 3b93714..0000000 --- a/roles/tgz_download/tasks/cached_version_write.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -# At this point atl_product_version should be set, cache if necessary. -- name: Write override cached version when specified - template: - src: version.j2 - dest: "{{ atl_product_version_cache }}" - force: false diff --git a/roles/tgz_download/tasks/fetch_product.yml b/roles/tgz_download/tasks/fetch_product.yml deleted file mode 100644 index 20ba477..0000000 --- a/roles/tgz_download/tasks/fetch_product.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -# Note: We don't the cache binary in the shared drive to the complexity -# around download race-conditions if multiple nodes are starting at -# the same time. When downloading from product-downloads.atlassian.com -# (which is a CDN) takes seconds anyway. -- name: Fetch product installer - get_url: - url: "{{ atl_product_download_url }}" - dest: "{{ atl_product_download }}" - mode: 0644 - force: false - -- name: Create target version directory - file: - path: "{{ atl_product_installation_base }}/{{ atl_product_version }}" - state: directory - owner: "{{ atl_product_user }}" - -- name: Unpack the product packages - unarchive: - remote_src: true - src: "{{ atl_product_download }}" - dest: "{{ atl_product_installation_base }}/{{ atl_product_version }}" - creates: "{{ atl_product_installation_base }}/{{ atl_product_version }}/bin/catalina.sh" - owner: "{{ atl_product_user }}" - group: "{{ atl_product_user }}" - mode: 0755 - # Strip off the lead product/version specific directory to normaise naming - extra_opts: - - "--strip-components=1" - -- name: Symlink the installed version to current - file: - src: "{{ atl_product_installation_base }}/{{ atl_product_version }}" - dest: "{{ atl_product_installation_current }}" - state: link - force: true diff --git a/roles/tgz_download/tasks/main.yml b/roles/tgz_download/tasks/main.yml deleted file mode 100644 index 3b2dbb9..0000000 --- a/roles/tgz_download/tasks/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -# Common case for most products and Jira editions. -- name: Fetch ServiceDesk metadata if necessary - include_tasks: "servicedesk_download.yml" - when: atl_product_edition == "jira-servicedesk" - -# Differences for ServiceDesk become fiddly enough that it's better to -# just split them out and move common functionality into individual -# task files. -- name: Fetch product metadata if necessary - include_tasks: "product_download.yml" - when: atl_product_edition != "jira-servicedesk" diff --git a/roles/tgz_download/tasks/product_download.yml b/roles/tgz_download/tasks/product_download.yml deleted file mode 100644 index 87ce301..0000000 --- a/roles/tgz_download/tasks/product_download.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- - -- name: Check for and load cached version - include_tasks: "cached_version_fetch.yml" - - -# Case: File doesn't exist and no version has been set; find latest. -- name: Fetch and cache latest version when no override - block: - - - name: Fetch the latest version from URL - set_fact: - atl_product_version_json: "{{ lookup('url', '{{ atl_product_latest_version_url }}') }}" - - - name: Set the local var to retrieved version - set_fact: - atl_product_version: "{{ atl_product_version_json.version }}" - - when: - not cached.stat.exists and - (atl_product_version is undefined or - not atl_product_version or - atl_product_version == "latest") - - -- name: Cache download version if necessary - include_tasks: "cached_version_write.yml" - - -- name: Fetch and unpack the product distribution - include_tasks: "fetch_product.yml" diff --git a/roles/tgz_download/tasks/servicedesk_download.yml b/roles/tgz_download/tasks/servicedesk_download.yml deleted file mode 100644 index 9a41f48..0000000 --- a/roles/tgz_download/tasks/servicedesk_download.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- - -- name: Check for and load cached version - include_tasks: "cached_version_fetch.yml" - - -# Case: File doesn't exist and no version has been set; find latest. -- name: Fetch and cache latest version when no override - block: - - - name: Fetch the ServiceDesk metadata from marketplace - set_fact: - atl_servicedesk_version_json: "{{ lookup('url', '{{ atl_servicedesk_latest_url }}') }}" - - - name: Set the Jira version for ServiceDesk - set_fact: - atl_product_version: "{{ atl_servicedesk_version_json.name }}" - atl_download_version: "{{ atl_servicedesk_version_json.name }}" - - when: - not cached.stat.exists and - (atl_product_version is undefined or - not atl_product_version or - atl_product_version == "latest") - - -- name: Cache download version if necessary - include_tasks: "cached_version_write.yml" - - -# We now have a ServiceDesk version, fetch the metadata to give us the -# download URL and Jira versioning information. -- name: Fetch the ServiceDesk metadata from marketplace - set_fact: - atl_servicedesk_version_json: "{{ lookup('url', '{{ atl_servicedesk_versioned_url }}') }}" - -- name: Extract the version and download information from the ServiceDesk metadata - set_fact: - atl_download_edition: "jira-software" - atl_download_version: "{{ atl_servicedesk_version_json.compatibilities[0].hosting.server.max.version }}" - atl_servicedesk_download_url: "{{ atl_servicedesk_version_json._embedded.artifact._links.binary.href }}" - - -- name: Fetch and unpack the Jira edition - include_tasks: "fetch_product.yml" - - -# FIXME: The following is a bit of a special-case for now; ideally we -# should convert this into a general plugin-installation role -# (esp. when we get to supporting Portfolio), but there's no use for ATM. -- name: Download ServiceDesk - get_url: - url: "{{ atl_servicedesk_download_url }}" - dest: "{{ atl_servicedesk_download_file }}" - mode: 0640 - force: false - -- name: Extract the plugin to the shared plugin directory - command: /usr/bin/unzip -jn "{{ atl_servicedesk_download_file }}" "*.jar" - args: - chdir: "{{ atl_product_shared_plugins }}" - creates: "{{ atl_product_shared_plugins }}/*servicedesk*.jar" - warn: false - -- name: Make plugins writable by the Jira user - file: - path: "{{ atl_product_shared_plugins }}" - owner: "{{ atl_product_user }}" - group: "{{ atl_product_user }}" - mode: 0750 - recurse: true diff --git a/roles/tgz_download/templates/version.j2 b/roles/tgz_download/templates/version.j2 deleted file mode 100644 index 7de6d7e..0000000 --- a/roles/tgz_download/templates/version.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ atl_product_version }}