From 13e91668ab7b4d45ae6750efa42b0e5f4e9aa37a Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 15 Apr 2019 16:13:51 +1000 Subject: [PATCH] DCD-224: Add unpacking of the downloaded tarball. --- .../molecule/version_override/tests/test_default.py | 6 ++++++ roles/jira_download/tasks/main.yml | 13 +++++++++++-- roles/product_common/tasks/main.yml | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/roles/jira_download/molecule/version_override/tests/test_default.py b/roles/jira_download/molecule/version_override/tests/test_default.py index 1b81145..f5d9fdb 100644 --- a/roles/jira_download/molecule/version_override/tests/test_default.py +++ b/roles/jira_download/molecule/version_override/tests/test_default.py @@ -22,4 +22,10 @@ def test_latest_is_downloaded(host): installer = host.file('/opt/atlassian/tmp/jira-software.7.13.2.tar.gz') assert installer.exists assert installer.user == 'root' + +def test_latest_is_unpacked(host): + installer = host.file('/opt/atlassian/jira-software/atlassian-jira-software-7.13.2-standalone') + assert installer.exists + assert installer.is_directory + assert installer.user == 'jira' assert installer.mode == 0o0755 diff --git a/roles/jira_download/tasks/main.yml b/roles/jira_download/tasks/main.yml index c5b5d07..21281cd 100644 --- a/roles/jira_download/tasks/main.yml +++ b/roles/jira_download/tasks/main.yml @@ -17,7 +17,7 @@ - name: Use version for product version command: "cat {{ atl_product_version_cache }}" register: atl_product_version_file - changed_when: False + changed_when: false # Note: We don't cache this in the shared drive to the complexity # around download race-conditions if multiple nodes are starting at @@ -27,5 +27,14 @@ get_url: url: "{{ atl_product_download_url }}" dest: "{{ atl_product_download }}" - mode: 0755 + mode: 0644 force: false + +- name: Unpack the product packages + unarchive: + remote_src: true + src: "{{ atl_product_download }}" + dest: "{{ atl_product_installation_dir }}" + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" + mode: 0755 diff --git a/roles/product_common/tasks/main.yml b/roles/product_common/tasks/main.yml index dd20c8b..50cd421 100644 --- a/roles/product_common/tasks/main.yml +++ b/roles/product_common/tasks/main.yml @@ -18,3 +18,4 @@ - "{{ atl_product_home }}" - "{{ atl_installer_temp }}" - "{{ atl_product_home_shared }}" + - "{{ atl_product_installation_dir }}"