From 44daf80d9a34ab4b29b4e12e585216fe6d8d1a0c Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Fri, 12 Jul 2019 11:40:00 +1000 Subject: [PATCH] DCD-484: Save tarballs with the correct suffix. --- roles/product_install/defaults/main.yml | 5 +++-- .../molecule/jira_tarball/tests/test_default.py | 2 +- roles/product_install/tasks/unpack_tarball.yml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 6cc5efd..211e76e 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -12,12 +12,13 @@ atl_download_format: 'installer' atl_download_format_suffix_map: installer: '-x64.bin' tarball: '.tar.gz' +atl_download_suffix: "{{ atl_download_format_suffix_map[atl_download_format] }}" 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_product_version }}{{ atl_download_format_suffix_map[atl_download_format] }}" +atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}{{ atl_download_suffix }}" -atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_product_version }}.bin" +atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_product_version }}{{ atl_download_suffix }}" atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" diff --git a/roles/product_install/molecule/jira_tarball/tests/test_default.py b/roles/product_install/molecule/jira_tarball/tests/test_default.py index 18c41a2..2f5d09b 100644 --- a/roles/product_install/molecule/jira_tarball/tests/test_default.py +++ b/roles/product_install/molecule/jira_tarball/tests/test_default.py @@ -23,6 +23,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.bin') + installer = host.file('/opt/atlassian/tmp/jira-core.'+upstream+'.tar.gz') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/tasks/unpack_tarball.yml b/roles/product_install/tasks/unpack_tarball.yml index e192c0e..196928f 100644 --- a/roles/product_install/tasks/unpack_tarball.yml +++ b/roles/product_install/tasks/unpack_tarball.yml @@ -8,7 +8,7 @@ owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" mode: 0755 - # Strip off the lead product/version specific directory to normaise naming + # Strip off the lead product/version specific directory to normalise naming extra_opts: - "--strip-components=1" # NOTE: Currently all products contain a `README.txt`, so use that as an 'unpacked' marker.