From 054e171da3c8c925534d979cbe60bfebafd5f589 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Thu, 10 Oct 2019 16:12:06 +1100 Subject: [PATCH 01/37] ITOPSENG-164 Save the binary to shared home adding a locking mechanism to avoid potential race condition. This also allows downloading of old binaries once no longer available to download --- roles/product_install/defaults/main.yml | 4 + roles/product_install/tasks/main.yml | 79 ++++++++++++++++--- .../tasks/unpack_installer.yml | 2 +- 3 files changed, 74 insertions(+), 11 deletions(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 211e76e..0741a94 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -22,6 +22,10 @@ atl_product_download_filename: "{{ atl_download_edition | default(atl_product_ed atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" +atl_product_home_shared_download_dir: "{{ atl_product_home_shared }}/downloads" +atl_product_home_shared_download: "{{ atl_product_home_shared_download_dir }}/{{ atl_product_download_filename }}" +atl_product_home_shared_download_lockdir: "{{ atl_product_home_shared_download }}_downloaded" + 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 }}" diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 77371fa..94cd6ba 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -116,6 +116,7 @@ - "{{ atl_product_home }}" - "{{ atl_product_installation_versioned }}" - "{{ atl_product_version_cache_dir }}" + - "{{ atl_product_home_shared_download_dir }}" changed_when: false # For Molecule idempotence check # At this point atl_product_version should be set, cache if necessary. @@ -125,17 +126,75 @@ dest: "{{ atl_product_version_cache }}" force: true +# For the first run a temp binary should be downloaded but moved to shared home to ensure all subsequent nodes have access +# to the same specific version binary. +# To prevent a race condition with multiple downloads at the same time a directory is used as a lockfile (atomic operation). -# 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: 0755 - force: false +- name: Assume temp binary should be downloaded + set_fact: + download_binary: yes + +# Check for product installer in home_shared and lockdir to determine if it needs to be downloaded again. +- name: Check download lock directory exists + stat: + path: "{{ atl_product_home_shared_download_lockdir }}" + register: download_lockdir + +- name: Check for presence of product installer in home_shared + stat: + path: "{{ atl_product_home_shared_download }}" + register: home_shared_downloaded + +# If binary exists and lockdir exists use this binary instead +- name: Check Lock Directory and binary exists on shared_home + set_fact: + download_binary: no + when: + - home_shared_downloaded.stat.exists + - download_lockdir.stat.isdir is defined + - download_lockdir.stat.isdir + +# If the binary was never installed, download it +- name: "Download product installer and move to shared directory" + block: + + - name: Fetch product installer + get_url: + url: "{{ atl_product_download_url }}" + dest: "{{ atl_product_download }}" + mode: 0755 + force: false + register: atl_product_downloaded + + - name: Remove lockdir to prevent nodes relying on binary when copying + file: + path: "{{ atl_product_home_shared_download_lockdir }}" + state: absent + when: atl_product_downloaded is succeeded + register: lockdir_removed + + - name: Copy temp installer to home_shared + copy: + src: "{{ atl_product_download }}" + dest: "{{ atl_product_home_shared_download }}" + remote_src: yes + when: lockdir_removed is succeeded + register: copied + + - name: Delete old temp installer + file: + path: "{{ atl_product_download }}" + state: absent + when: copied is succeeded + register: temp_deleted + + - name: Create lockdir once product installer downloaded and moved + file: + path: "{{ atl_product_home_shared_download_lockdir }}" + state: directory + when: temp_deleted is succeeded + + when: download_binary - name: Unpack the downloaded application depending on format include_tasks: "unpack_{{ atl_download_format }}.yml" diff --git a/roles/product_install/tasks/unpack_installer.yml b/roles/product_install/tasks/unpack_installer.yml index 925dca0..11d37e3 100644 --- a/roles/product_install/tasks/unpack_installer.yml +++ b/roles/product_install/tasks/unpack_installer.yml @@ -11,7 +11,7 @@ # will create 'jira1'; this potentially creates idempotency/upgrade # issues down the line. - name: Run the installer - command: /bin/sh "{{ atl_product_download }}" -q -varfile "{{ atl_product_varfile }}" + command: /bin/sh "{{ atl_product_home_shared_download }}" -q -varfile "{{ atl_product_varfile }}" args: creates: "{{ atl_product_installation_versioned }}/.install4j/" become: true From 3ed48340b3553a811fdc948c467e902f3a3c1e1a Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Thu, 10 Oct 2019 16:52:51 +1100 Subject: [PATCH 02/37] ITOPSENG-164 Yamllint fix --- roles/product_install/tasks/main.yml | 81 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 94cd6ba..8a90eb3 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -126,15 +126,18 @@ dest: "{{ atl_product_version_cache }}" force: true -# For the first run a temp binary should be downloaded but moved to shared home to ensure all subsequent nodes have access +# For the first run a temp binary should be downloaded but moved to +# shared home to ensure all subsequent nodes have access # to the same specific version binary. -# To prevent a race condition with multiple downloads at the same time a directory is used as a lockfile (atomic operation). +# To prevent a race condition with multiple downloads at the same time +# a directory is used as a lockfile (atomic operation). - name: Assume temp binary should be downloaded set_fact: - download_binary: yes + download_binary: true -# Check for product installer in home_shared and lockdir to determine if it needs to be downloaded again. +# Check for product installer in home_shared and lockdir to determine +# if it needs to be downloaded again. - name: Check download lock directory exists stat: path: "{{ atl_product_home_shared_download_lockdir }}" @@ -148,51 +151,51 @@ # If binary exists and lockdir exists use this binary instead - name: Check Lock Directory and binary exists on shared_home set_fact: - download_binary: no + download_binary: false when: - - home_shared_downloaded.stat.exists - - download_lockdir.stat.isdir is defined - - download_lockdir.stat.isdir + - home_shared_downloaded.stat.exists + - download_lockdir.stat.isdir is defined + - download_lockdir.stat.isdir # If the binary was never installed, download it - name: "Download product installer and move to shared directory" block: - - name: Fetch product installer - get_url: - url: "{{ atl_product_download_url }}" - dest: "{{ atl_product_download }}" - mode: 0755 - force: false - register: atl_product_downloaded + - name: Fetch product installer + get_url: + url: "{{ atl_product_download_url }}" + dest: "{{ atl_product_download }}" + mode: 0755 + force: false + register: atl_product_downloaded - - name: Remove lockdir to prevent nodes relying on binary when copying - file: - path: "{{ atl_product_home_shared_download_lockdir }}" - state: absent - when: atl_product_downloaded is succeeded - register: lockdir_removed + - name: Remove lockdir to prevent nodes relying on binary when copying + file: + path: "{{ atl_product_home_shared_download_lockdir }}" + state: absent + when: atl_product_downloaded is succeeded + register: lockdir_removed - - name: Copy temp installer to home_shared - copy: - src: "{{ atl_product_download }}" - dest: "{{ atl_product_home_shared_download }}" - remote_src: yes - when: lockdir_removed is succeeded - register: copied + - name: Copy temp installer to home_shared + copy: + src: "{{ atl_product_download }}" + dest: "{{ atl_product_home_shared_download }}" + remote_src: true + when: lockdir_removed is succeeded + register: copied - - name: Delete old temp installer - file: - path: "{{ atl_product_download }}" - state: absent - when: copied is succeeded - register: temp_deleted + - name: Delete old temp installer + file: + path: "{{ atl_product_download }}" + state: absent + when: copied is succeeded + register: temp_deleted - - name: Create lockdir once product installer downloaded and moved - file: - path: "{{ atl_product_home_shared_download_lockdir }}" - state: directory - when: temp_deleted is succeeded + - name: Create lockdir once product installer downloaded and moved + file: + path: "{{ atl_product_home_shared_download_lockdir }}" + state: directory + when: temp_deleted is succeeded when: download_binary From b3dffa684f112196438ed29830556ce2d573c47b Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 11 Oct 2019 14:20:21 +1100 Subject: [PATCH 03/37] ITOPSENG-164 Further testing required for logic change --- roles/product_install/defaults/main.yml | 5 +- roles/product_install/tasks/main.yml | 136 +++++++++++------- .../tasks/unpack_installer.yml | 4 +- 3 files changed, 93 insertions(+), 52 deletions(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 0741a94..8798ac7 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -19,12 +19,13 @@ atl_product_base_url: "{{ atl_release_base_url }}/{{ atl_product_family }}/downl 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 }}{{ atl_download_suffix }}" -atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" +atl_product_temp_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" atl_product_home_shared_download_dir: "{{ atl_product_home_shared }}/downloads" atl_product_home_shared_download: "{{ atl_product_home_shared_download_dir }}/{{ atl_product_download_filename }}" -atl_product_home_shared_download_lockdir: "{{ atl_product_home_shared_download }}_downloaded" +atl_product_home_shared_lockdir_moving: "{{ atl_product_home_shared_download }}_moving" +atl_product_home_shared_lockdir_downloaded: "{{ atl_product_home_shared_download }}_downloaded" atl_marketplace_base: "https://marketplace.atlassian.com" atl_servicedesk_latest_url: "https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest" diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 8a90eb3..0d78a2c 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -132,73 +132,52 @@ # To prevent a race condition with multiple downloads at the same time # a directory is used as a lockfile (atomic operation). -- name: Assume temp binary should be downloaded +- name: Assume temp binary should be downloaded and used set_fact: download_binary: true + atl_product_download: "{{ atl_product_temp_download }}" # Check for product installer in home_shared and lockdir to determine # if it needs to be downloaded again. -- name: Check download lock directory exists +- name: Check moving lock directory does not exist stat: - path: "{{ atl_product_home_shared_download_lockdir }}" - register: download_lockdir + path: "{{ atl_product_home_shared_moving_lock }}" + register: moving_lock + +- name: Check downloaded lock directory exists + stat: + path: "{{ atl_product_home_shared_downloaded_lock }}" + register: downloaded_lock - name: Check for presence of product installer in home_shared stat: path: "{{ atl_product_home_shared_download }}" - register: home_shared_downloaded + register: home_shared_download # If binary exists and lockdir exists use this binary instead -- name: Check Lock Directory and binary exists on shared_home +- name: Check lock directory and binary exists on shared_home set_fact: download_binary: false + atl_product_download: "{{ atl_product_home_shared_download }}" when: - - home_shared_downloaded.stat.exists - - download_lockdir.stat.isdir is defined - - download_lockdir.stat.isdir - -# If the binary was never installed, download it -- name: "Download product installer and move to shared directory" - block: - - - name: Fetch product installer - get_url: - url: "{{ atl_product_download_url }}" - dest: "{{ atl_product_download }}" - mode: 0755 - force: false - register: atl_product_downloaded - - - name: Remove lockdir to prevent nodes relying on binary when copying - file: - path: "{{ atl_product_home_shared_download_lockdir }}" - state: absent - when: atl_product_downloaded is succeeded - register: lockdir_removed - - - name: Copy temp installer to home_shared - copy: - src: "{{ atl_product_download }}" - dest: "{{ atl_product_home_shared_download }}" - remote_src: true - when: lockdir_removed is succeeded - register: copied - - - name: Delete old temp installer - file: - path: "{{ atl_product_download }}" - state: absent - when: copied is succeeded - register: temp_deleted - - - name: Create lockdir once product installer downloaded and moved - file: - path: "{{ atl_product_home_shared_download_lockdir }}" - state: directory - when: temp_deleted is succeeded + - home_shared_download.stat.exists + - downloaded_lock.stat.isdir is defined + - downloaded_lock.stat.isdir + - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) +# If the binary was never installed, download it to temp location +- name: Installer not on home_shared. Fetch it. + get_url: + url: "{{ atl_product_download_url }}" + dest: "{{ atl_product_temp_download }}" + mode: 0755 + force: false + register: atl_product_downloaded when: download_binary +# If product installer was fetched to temp, install from there +# If product installer was pre-downloaded on shared_home, install from there +# This is determined by {{ atl_product_download }} variable - name: Unpack the downloaded application depending on format include_tasks: "unpack_{{ atl_download_format }}.yml" @@ -208,3 +187,62 @@ dest: "{{ atl_product_installation_current }}" state: link force: true + +# # Product is installed. If the following are true, move to home_shared +# # 1. This node just downloaded binary. +# # 2. Another node is not already moving into place. +# - name: "Move product installer" +# block: + +# - name: Check moving lock directory does not exist +# stat: +# path: "{{ atl_product_home_shared_moving_lock }}" +# register: moving_lock + +# - name: Check downloaded lock directory exists +# stat: +# path: "{{ atl_product_home_shared_downloaded_lock }}" +# register: downloaded_lock + +# - name: Check for presence of product installer in home_shared +# stat: +# path: "{{ atl_product_home_shared_download }}" +# register: home_shared_download + + + + + + + +# - name: Remove lockdir to prevent nodes relying on binary when copying +# file: +# path: "{{ atl_product_home_shared_download_lockdir }}" +# state: absent +# when: atl_product_downloaded is succeeded +# register: lockdir_removed + +# - name: Copy temp installer to home_shared +# copy: +# src: "{{ atl_product_download }}" +# dest: "{{ atl_product_home_shared_download }}" +# remote_src: true +# when: lockdir_removed is succeeded +# register: copied + +# - name: Delete old temp installer +# file: +# path: "{{ atl_product_download }}" +# state: absent +# when: copied is succeeded +# register: temp_deleted + +# - name: Create lockdir once product installer downloaded and moved +# file: +# path: "{{ atl_product_home_shared_download_lockdir }}" +# state: directory +# when: temp_deleted is succeeded + + + + diff --git a/roles/product_install/tasks/unpack_installer.yml b/roles/product_install/tasks/unpack_installer.yml index 11d37e3..f340463 100644 --- a/roles/product_install/tasks/unpack_installer.yml +++ b/roles/product_install/tasks/unpack_installer.yml @@ -10,8 +10,10 @@ # actions. For example, if root and the 'jira' user exists then it # will create 'jira1'; this potentially creates idempotency/upgrade # issues down the line. +# The variable {{ atl_product_download }} will be on temp for first nodes and shared_home for +# subsequent nodes. - name: Run the installer - command: /bin/sh "{{ atl_product_home_shared_download }}" -q -varfile "{{ atl_product_varfile }}" + command: /bin/sh "{{ atl_product_download }}" -q -varfile "{{ atl_product_varfile }}" args: creates: "{{ atl_product_installation_versioned }}/.install4j/" become: true From 894501e9d191feb7b069b15b1c45bac5c3bcd38d Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 11 Oct 2019 14:32:50 +1100 Subject: [PATCH 04/37] ITOPSENG-164 Additional default variables --- roles/product_install/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 8798ac7..61d8d04 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -24,8 +24,8 @@ atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" atl_product_home_shared_download_dir: "{{ atl_product_home_shared }}/downloads" atl_product_home_shared_download: "{{ atl_product_home_shared_download_dir }}/{{ atl_product_download_filename }}" -atl_product_home_shared_lockdir_moving: "{{ atl_product_home_shared_download }}_moving" -atl_product_home_shared_lockdir_downloaded: "{{ atl_product_home_shared_download }}_downloaded" +atl_product_home_shared_moving_lock: "{{ atl_product_home_shared_download }}_moving" +atl_product_home_shared_downloaded_lock: "{{ atl_product_home_shared_download }}_downloaded" atl_marketplace_base: "https://marketplace.atlassian.com" atl_servicedesk_latest_url: "https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest" From b73381e907d125f304efe65107ff20443db082b9 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 11 Oct 2019 14:52:35 +1100 Subject: [PATCH 05/37] ITOPSENG-164 Further testing required for logic change --- roles/product_install/tasks/main.yml | 129 +++++++++++++++------------ 1 file changed, 73 insertions(+), 56 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 0d78a2c..a23f98b 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -130,26 +130,27 @@ # shared home to ensure all subsequent nodes have access # to the same specific version binary. # To prevent a race condition with multiple downloads at the same time -# a directory is used as a lockfile (atomic operation). +# a directory is used as a lockfile (atomic operation) when moving binary. -- name: Assume temp binary should be downloaded and used +- name: Set assumptions to avoid race condition set_fact: download_binary: true + move_binary: false atl_product_download: "{{ atl_product_temp_download }}" # Check for product installer in home_shared and lockdir to determine # if it needs to be downloaded again. -- name: Check moving lock directory does not exist +- name: Check for moving lock directory stat: path: "{{ atl_product_home_shared_moving_lock }}" register: moving_lock -- name: Check downloaded lock directory exists +- name: Check for downloaded lock directory stat: path: "{{ atl_product_home_shared_downloaded_lock }}" register: downloaded_lock -- name: Check for presence of product installer in home_shared +- name: Check for product installer in home_shared stat: path: "{{ atl_product_home_shared_download }}" register: home_shared_download @@ -188,60 +189,76 @@ state: link force: true -# # Product is installed. If the following are true, move to home_shared -# # 1. This node just downloaded binary. -# # 2. Another node is not already moving into place. -# - name: "Move product installer" -# block: +# Product is installed. If the following are true, move to home_shared +# 1. This node just downloaded binary. +# 2. Another node is not already moving into place. +- name: "Move product installer" + block: -# - name: Check moving lock directory does not exist -# stat: -# path: "{{ atl_product_home_shared_moving_lock }}" -# register: moving_lock + - name: Check again for moving lock directory + stat: + path: "{{ atl_product_home_shared_moving_lock }}" + register: moving_lock_2 -# - name: Check downloaded lock directory exists -# stat: -# path: "{{ atl_product_home_shared_downloaded_lock }}" -# register: downloaded_lock + - name: Check again for downloaded lock directory + stat: + path: "{{ atl_product_home_shared_downloaded_lock }}" + register: downloaded_lock_2 -# - name: Check for presence of product installer in home_shared -# stat: -# path: "{{ atl_product_home_shared_download }}" -# register: home_shared_download - - - - - - - -# - name: Remove lockdir to prevent nodes relying on binary when copying -# file: -# path: "{{ atl_product_home_shared_download_lockdir }}" -# state: absent -# when: atl_product_downloaded is succeeded -# register: lockdir_removed - -# - name: Copy temp installer to home_shared -# copy: -# src: "{{ atl_product_download }}" -# dest: "{{ atl_product_home_shared_download }}" -# remote_src: true -# when: lockdir_removed is succeeded -# register: copied - -# - name: Delete old temp installer -# file: -# path: "{{ atl_product_download }}" -# state: absent -# when: copied is succeeded -# register: temp_deleted - -# - name: Create lockdir once product installer downloaded and moved -# file: -# path: "{{ atl_product_home_shared_download_lockdir }}" -# state: directory -# when: temp_deleted is succeeded + - name: Check again for product installer in home_shared + stat: + path: "{{ atl_product_home_shared_download }}" + register: home_shared_download_2 + + # If binary exists and lockdir exists use this binary instead + - name: Check lock directory and binary exists on shared_home + set_fact: + move_binary: true + atl_product_download: "{{ atl_product_home_shared_download }}" + when: + - home_shared_download.stat.exists == False + - ( downloaded_lock.stat.isdir is not defined or downloaded_lock.stat.isdir == False ) + - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) + + - name: Create moving_lock to ensure other nodes skip + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: directory + when: move_binary + register: moving_lock_created + + - name: Copy temp installer to home_shared + copy: + src: "{{ atl_product_temp_download }}" + dest: "{{ atl_product_home_shared_download }}" + remote_src: true + when: moving_lock_created is succeeded + register: copied + + - name: Create downloaded_lock once product installer downloaded and copied + file: + path: "{{ atl_product_home_shared_downloaded_lock }}" + state: directory + when: copied is succeeded + register: downloaded_lock_created + + - name: Remove moving_lock to show that binary is completed + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: absent + when: + - downloaded_lock_created is succeeded + - copied is succeeded + register: moving_lock_removed + + - name: Delete old temp installer + file: + path: "{{ atl_product_temp_download }}" + state: absent + when: moving_lock_removed is succeeded + register: temp_deleted + + when: move_binary From 5d10948feb5ece672309e3dc58a458386a93180f Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 11 Oct 2019 14:54:59 +1100 Subject: [PATCH 06/37] ITOPSENG-164 Further testing required for logic change --- roles/product_install/tasks/main.yml | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index a23f98b..d6c7b61 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -220,43 +220,43 @@ - ( downloaded_lock.stat.isdir is not defined or downloaded_lock.stat.isdir == False ) - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) - - name: Create moving_lock to ensure other nodes skip - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: directory - when: move_binary - register: moving_lock_created + - name: Create moving_lock to ensure other nodes skip + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: directory + when: move_binary + register: moving_lock_created - - name: Copy temp installer to home_shared - copy: - src: "{{ atl_product_temp_download }}" - dest: "{{ atl_product_home_shared_download }}" - remote_src: true - when: moving_lock_created is succeeded - register: copied + - name: Copy temp installer to home_shared + copy: + src: "{{ atl_product_temp_download }}" + dest: "{{ atl_product_home_shared_download }}" + remote_src: true + when: moving_lock_created is succeeded + register: copied - - name: Create downloaded_lock once product installer downloaded and copied - file: - path: "{{ atl_product_home_shared_downloaded_lock }}" - state: directory - when: copied is succeeded - register: downloaded_lock_created + - name: Create downloaded_lock once product installer downloaded and copied + file: + path: "{{ atl_product_home_shared_downloaded_lock }}" + state: directory + when: copied is succeeded + register: downloaded_lock_created - - name: Remove moving_lock to show that binary is completed - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: absent - when: - - downloaded_lock_created is succeeded - - copied is succeeded - register: moving_lock_removed + - name: Remove moving_lock to show that binary is completed + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: absent + when: + - downloaded_lock_created is succeeded + - copied is succeeded + register: moving_lock_removed - - name: Delete old temp installer - file: - path: "{{ atl_product_temp_download }}" - state: absent - when: moving_lock_removed is succeeded - register: temp_deleted + - name: Delete old temp installer + file: + path: "{{ atl_product_temp_download }}" + state: absent + when: moving_lock_removed is succeeded + register: temp_deleted when: move_binary From fbb9316c26eea2383df30345a34b4e6b69da4c69 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 11 Oct 2019 16:37:28 +1100 Subject: [PATCH 07/37] ITOPSENG-164 Further testing required for logic change --- roles/product_install/tasks/main.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index d6c7b61..f12f987 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -189,10 +189,12 @@ state: link force: true -# Product is installed. If the following are true, move to home_shared +# Temp product was downloaded and installed. +# If the following conditions are true, move to home_shared # 1. This node just downloaded binary. # 2. Another node is not already moving into place. -- name: "Move product installer" +# 3. The binary is downloaded and lockdir in place. +- name: "Check move product installer" block: - name: Check again for moving lock directory @@ -214,11 +216,15 @@ - name: Check lock directory and binary exists on shared_home set_fact: move_binary: true - atl_product_download: "{{ atl_product_home_shared_download }}" when: - - home_shared_download.stat.exists == False - - ( downloaded_lock.stat.isdir is not defined or downloaded_lock.stat.isdir == False ) - - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) + - ( home_shared_download.stat.exists == False or + downloaded_lock.stat.isdir is not defined or downloaded_lock.stat.isdir == False ) + - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) + + when: download_binary + +- name: "Move product installer if required" + block: - name: Create moving_lock to ensure other nodes skip file: From 0a6501d781fe78e17c44982730006f436da3a3dd Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Mon, 14 Oct 2019 17:29:16 +1100 Subject: [PATCH 08/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 192 +++++++++++++++------------ 1 file changed, 104 insertions(+), 88 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index f12f987..040b2ef 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -138,17 +138,11 @@ move_binary: false atl_product_download: "{{ atl_product_temp_download }}" -# Check for product installer in home_shared and lockdir to determine -# if it needs to be downloaded again. -- name: Check for moving lock directory +# Check for pre-downloaded binary on shared_home and completed lock dir. +- name: Check for completed lock directory stat: - path: "{{ atl_product_home_shared_moving_lock }}" - register: moving_lock - -- name: Check for downloaded lock directory - stat: - path: "{{ atl_product_home_shared_downloaded_lock }}" - register: downloaded_lock + path: "{{ atl_product_home_shared_completed_lock }}" + register: completed_lock - name: Check for product installer in home_shared stat: @@ -162,9 +156,8 @@ atl_product_download: "{{ atl_product_home_shared_download }}" when: - home_shared_download.stat.exists - - downloaded_lock.stat.isdir is defined - - downloaded_lock.stat.isdir - - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) + - completed_lock.stat.isdir is defined + - completed_lock.stat.isdir # If the binary was never installed, download it to temp location - name: Installer not on home_shared. Fetch it. @@ -173,98 +166,121 @@ dest: "{{ atl_product_temp_download }}" mode: 0755 force: false - register: atl_product_downloaded + register: atl_product_completed when: download_binary -# If product installer was fetched to temp, install from there -# If product installer was pre-downloaded on shared_home, install from there -# This is determined by {{ atl_product_download }} variable -- name: Unpack the downloaded application depending on format - include_tasks: "unpack_{{ atl_download_format }}.yml" +# If product installer was fetched +# Make the moving directory +# - failure, continue and install from temp +# - success, move binary and install from shared_home -- name: Symlink the installed version to current +- name: Create moving_lock. file: - src: "{{ atl_product_installation_versioned }}" - dest: "{{ atl_product_installation_current }}" - state: link - force: true + path: "{{ atl_product_home_shared_moving_lock }}" + state: directory + when: download_binary is succeeded + register: moving_lock_created -# Temp product was downloaded and installed. -# If the following conditions are true, move to home_shared -# 1. This node just downloaded binary. -# 2. Another node is not already moving into place. -# 3. The binary is downloaded and lockdir in place. -- name: "Check move product installer" - block: +- name: Debug Scenario A - lock created + debug: lock created + when: moving_lock_created is succeeded - - name: Check again for moving lock directory - stat: - path: "{{ atl_product_home_shared_moving_lock }}" - register: moving_lock_2 +- name: Debug Scenario B - lock cannot created + debug: lock not created + when: moving_lock_created is failed + + + + + +# # If product installer was pre-downloaded on shared_home, install from there +# # This is determined by {{ atl_product_download }} variable +# - name: Unpack the downloaded application depending on format +# include_tasks: "unpack_{{ atl_download_format }}.yml" + +# - name: Symlink the installed version to current +# file: +# src: "{{ atl_product_installation_versioned }}" +# dest: "{{ atl_product_installation_current }}" +# state: link +# force: true + +# # Temp product was downloaded and installed. +# # If the following conditions are true, move to home_shared +# # 1. This node just downloaded binary. +# # 2. Another node is not already moving into place. +# # 3. The binary is downloaded and lockdir in place. +# - name: "Check move product installer" +# block: + +# - name: Check again for moving lock directory +# stat: +# path: "{{ atl_product_home_shared_moving_lock }}" +# register: moving_lock_2 - - name: Check again for downloaded lock directory - stat: - path: "{{ atl_product_home_shared_downloaded_lock }}" - register: downloaded_lock_2 +# - name: Check again for completed lock directory +# stat: +# path: "{{ atl_product_home_shared_completed_lock }}" +# register: completed_lock_2 - - name: Check again for product installer in home_shared - stat: - path: "{{ atl_product_home_shared_download }}" - register: home_shared_download_2 +# - name: Check again for product installer in home_shared +# stat: +# path: "{{ atl_product_home_shared_download }}" +# register: home_shared_download_2 - # If binary exists and lockdir exists use this binary instead - - name: Check lock directory and binary exists on shared_home - set_fact: - move_binary: true - when: - - ( home_shared_download.stat.exists == False or - downloaded_lock.stat.isdir is not defined or downloaded_lock.stat.isdir == False ) - - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) +# # If binary exists and lockdir exists use this binary instead +# - name: Check lock directory and binary exists on shared_home +# set_fact: +# move_binary: true +# when: +# - ( home_shared_download.stat.exists == False or +# completed_lock.stat.isdir is not defined or completed_lock.stat.isdir == False ) +# - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) - when: download_binary +# when: download_binary -- name: "Move product installer if required" - block: +# - name: "Move product installer if required" +# block: - - name: Create moving_lock to ensure other nodes skip - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: directory - when: move_binary - register: moving_lock_created +# - name: Create moving_lock to ensure other nodes skip +# file: +# path: "{{ atl_product_home_shared_moving_lock }}" +# state: directory +# when: move_binary +# register: moving_lock_created - - name: Copy temp installer to home_shared - copy: - src: "{{ atl_product_temp_download }}" - dest: "{{ atl_product_home_shared_download }}" - remote_src: true - when: moving_lock_created is succeeded - register: copied +# - name: Copy temp installer to home_shared +# copy: +# src: "{{ atl_product_temp_download }}" +# dest: "{{ atl_product_home_shared_download }}" +# remote_src: true +# when: moving_lock_created is succeeded +# register: copied - - name: Create downloaded_lock once product installer downloaded and copied - file: - path: "{{ atl_product_home_shared_downloaded_lock }}" - state: directory - when: copied is succeeded - register: downloaded_lock_created +# - name: Create completed_lock once product installer downloaded and copied +# file: +# path: "{{ atl_product_home_shared_completed_lock }}" +# state: directory +# when: copied is succeeded +# register: completed_lock_created - - name: Remove moving_lock to show that binary is completed - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: absent - when: - - downloaded_lock_created is succeeded - - copied is succeeded - register: moving_lock_removed +# - name: Remove moving_lock to show that binary is completed +# file: +# path: "{{ atl_product_home_shared_moving_lock }}" +# state: absent +# when: +# - completed_lock_created is succeeded +# - copied is succeeded +# register: moving_lock_removed - - name: Delete old temp installer - file: - path: "{{ atl_product_temp_download }}" - state: absent - when: moving_lock_removed is succeeded - register: temp_deleted +# - name: Delete old temp installer +# file: +# path: "{{ atl_product_temp_download }}" +# state: absent +# when: moving_lock_removed is succeeded +# register: temp_deleted - when: move_binary +# when: move_binary From 70a48e58c4a2d178b1043b4218bc9e6b15a89823 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Mon, 14 Oct 2019 17:34:05 +1100 Subject: [PATCH 09/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 61d8d04..931e639 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -25,7 +25,7 @@ atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" atl_product_home_shared_download_dir: "{{ atl_product_home_shared }}/downloads" atl_product_home_shared_download: "{{ atl_product_home_shared_download_dir }}/{{ atl_product_download_filename }}" atl_product_home_shared_moving_lock: "{{ atl_product_home_shared_download }}_moving" -atl_product_home_shared_downloaded_lock: "{{ atl_product_home_shared_download }}_downloaded" +atl_product_home_shared_completed_lock: "{{ atl_product_home_shared_download }}_completed" atl_marketplace_base: "https://marketplace.atlassian.com" atl_servicedesk_latest_url: "https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions/latest" From 9dea02808c49ad56d52b73b3bbc8c9f237efc351 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:16:52 +1100 Subject: [PATCH 10/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 32 +++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 040b2ef..54e74c1 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -169,25 +169,33 @@ register: atl_product_completed when: download_binary -# If product installer was fetched -# Make the moving directory -# - failure, continue and install from temp -# - success, move binary and install from shared_home - +# If product installer was fetched make the moving directory - name: Create moving_lock. file: path: "{{ atl_product_home_shared_moving_lock }}" state: directory - when: download_binary is succeeded + when: + - atl_product_completed is succeeded register: moving_lock_created -- name: Debug Scenario A - lock created - debug: lock created - when: moving_lock_created is succeeded +# Directory lock was created by this run +# - Move binary +- name: Move binary Scenario - lock created by this run + debug: + msg: lock created + set_fact: + move_binary: true + when: + - moving_lock_created is succeeded + - moving_lock_created.changed == True -- name: Debug Scenario B - lock cannot created - debug: lock not created - when: moving_lock_created is failed +# Directory lock was either already created or could not be +# - Continue and install from temp +- name: Continue Scenario - lock cannot be created or created by previous run + debug: + msg: lock not created + when: moving_lock_created is not succeeded or + ( moving_lock_created is succeeded and moving_lock_created.changed == False ) From eedea5e32647adba15bd004e7b509f7fad7e946e Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:23:06 +1100 Subject: [PATCH 11/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 54e74c1..ad490f6 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -181,8 +181,6 @@ # Directory lock was created by this run # - Move binary - name: Move binary Scenario - lock created by this run - debug: - msg: lock created set_fact: move_binary: true when: From 2ac847dd3ab88ceb54fdeb3dc6c8a19082297b7f Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:28:48 +1100 Subject: [PATCH 12/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 74 ++++++++++++++++------------ 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index ad490f6..288b0f6 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -196,6 +196,48 @@ ( moving_lock_created is succeeded and moving_lock_created.changed == False ) +# Move binary block +- name: Move product installer to home_shared + block: + + - name: Copy temp installer to home_shared + copy: + src: "{{ atl_product_temp_download }}" + dest: "{{ atl_product_home_shared_download }}" + remote_src: true + when: + - moving_lock_created is succeeded + - moving_lock_created.changed == True + register: copied + + - name: Create completed_lock once product installer downloaded and copied + file: + path: "{{ atl_product_home_shared_completed_lock }}" + state: directory + when: copied is succeeded + register: completed_lock_created + + - name: Remove moving_lock to show that binary is completed + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: absent + when: + - completed_lock_created is succeeded + - copied is succeeded + register: moving_lock_removed + + - name: Delete old temp installer + file: + path: "{{ atl_product_temp_download }}" + state: absent + when: moving_lock_removed is succeeded + register: temp_deleted + + when: move_binary + + + + @@ -255,38 +297,6 @@ # when: move_binary # register: moving_lock_created -# - name: Copy temp installer to home_shared -# copy: -# src: "{{ atl_product_temp_download }}" -# dest: "{{ atl_product_home_shared_download }}" -# remote_src: true -# when: moving_lock_created is succeeded -# register: copied - -# - name: Create completed_lock once product installer downloaded and copied -# file: -# path: "{{ atl_product_home_shared_completed_lock }}" -# state: directory -# when: copied is succeeded -# register: completed_lock_created - -# - name: Remove moving_lock to show that binary is completed -# file: -# path: "{{ atl_product_home_shared_moving_lock }}" -# state: absent -# when: -# - completed_lock_created is succeeded -# - copied is succeeded -# register: moving_lock_removed - -# - name: Delete old temp installer -# file: -# path: "{{ atl_product_temp_download }}" -# state: absent -# when: moving_lock_removed is succeeded -# register: temp_deleted - -# when: move_binary From 46e3665cd561cd0b4f0425ce0ff18b996b0fcab2 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:50:48 +1100 Subject: [PATCH 13/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 72 +++++++++++++++------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 288b0f6..3665698 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -159,42 +159,46 @@ - completed_lock.stat.isdir is defined - completed_lock.stat.isdir -# If the binary was never installed, download it to temp location -- name: Installer not on home_shared. Fetch it. - get_url: - url: "{{ atl_product_download_url }}" - dest: "{{ atl_product_temp_download }}" - mode: 0755 - force: false - register: atl_product_completed +# Fetch binary if required +- name: download_binary is true so fetch and do all the things + block: + + - name: Fetch binary + get_url: + url: "{{ atl_product_download_url }}" + dest: "{{ atl_product_temp_download }}" + mode: 0755 + force: false + register: atl_product_completed + + # If product installer was fetched make the moving directory + - name: Create moving_lock. + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: directory + when: + - atl_product_completed is succeeded + register: moving_lock_created + + # Directory lock was created by this run + # - Move binary + - name: Move binary Scenario - lock created by this run + set_fact: + move_binary: true + when: + - moving_lock_created is succeeded + - moving_lock_created.changed == True + + # Directory lock was either already created or could not be + # - Continue and install from temp + - name: Continue Scenario - lock cannot be created or created by previous run + debug: + msg: lock not created + when: moving_lock_created is not succeeded or + ( moving_lock_created is succeeded and moving_lock_created.changed == False ) + when: download_binary -# If product installer was fetched make the moving directory -- name: Create moving_lock. - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: directory - when: - - atl_product_completed is succeeded - register: moving_lock_created - -# Directory lock was created by this run -# - Move binary -- name: Move binary Scenario - lock created by this run - set_fact: - move_binary: true - when: - - moving_lock_created is succeeded - - moving_lock_created.changed == True - -# Directory lock was either already created or could not be -# - Continue and install from temp -- name: Continue Scenario - lock cannot be created or created by previous run - debug: - msg: lock not created - when: moving_lock_created is not succeeded or - ( moving_lock_created is succeeded and moving_lock_created.changed == False ) - # Move binary block - name: Move product installer to home_shared From b9c5389ef5fc33758ca5eeeed959940475c921e6 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:53:25 +1100 Subject: [PATCH 14/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 77 ++++------------------------ 1 file changed, 11 insertions(+), 66 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 3665698..eba1b6b 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -199,7 +199,6 @@ when: download_binary - # Move binary block - name: Move product installer to home_shared block: @@ -239,69 +238,15 @@ when: move_binary +# At this point the binary is in place and can be used to install +# The location is determined by {{ atl_product_download }} variable +# set above +- name: Unpack the downloaded application depending on format + include_tasks: "unpack_{{ atl_download_format }}.yml" - - - - - -# # If product installer was pre-downloaded on shared_home, install from there -# # This is determined by {{ atl_product_download }} variable -# - name: Unpack the downloaded application depending on format -# include_tasks: "unpack_{{ atl_download_format }}.yml" - -# - name: Symlink the installed version to current -# file: -# src: "{{ atl_product_installation_versioned }}" -# dest: "{{ atl_product_installation_current }}" -# state: link -# force: true - -# # Temp product was downloaded and installed. -# # If the following conditions are true, move to home_shared -# # 1. This node just downloaded binary. -# # 2. Another node is not already moving into place. -# # 3. The binary is downloaded and lockdir in place. -# - name: "Check move product installer" -# block: - -# - name: Check again for moving lock directory -# stat: -# path: "{{ atl_product_home_shared_moving_lock }}" -# register: moving_lock_2 - -# - name: Check again for completed lock directory -# stat: -# path: "{{ atl_product_home_shared_completed_lock }}" -# register: completed_lock_2 - -# - name: Check again for product installer in home_shared -# stat: -# path: "{{ atl_product_home_shared_download }}" -# register: home_shared_download_2 - -# # If binary exists and lockdir exists use this binary instead -# - name: Check lock directory and binary exists on shared_home -# set_fact: -# move_binary: true -# when: -# - ( home_shared_download.stat.exists == False or -# completed_lock.stat.isdir is not defined or completed_lock.stat.isdir == False ) -# - ( moving_lock.stat.isdir is not defined or moving_lock.stat.isdir == False ) - -# when: download_binary - -# - name: "Move product installer if required" -# block: - -# - name: Create moving_lock to ensure other nodes skip -# file: -# path: "{{ atl_product_home_shared_moving_lock }}" -# state: directory -# when: move_binary -# register: moving_lock_created - - - - - +- name: Symlink the installed version to current + file: + src: "{{ atl_product_installation_versioned }}" + dest: "{{ atl_product_installation_current }}" + state: link + force: true From 2c1ce5bc2e18b1f883a96e978576443fb8b68292 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 10:57:51 +1100 Subject: [PATCH 15/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index eba1b6b..30d3cce 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -163,6 +163,10 @@ - name: download_binary is true so fetch and do all the things block: + - name: debug + msg: + - Download the binary + - name: Fetch binary get_url: url: "{{ atl_product_download_url }}" From cc5b3c8a70662a3dee8141650770599851b5f523 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 11:03:03 +1100 Subject: [PATCH 16/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 30d3cce..349df3e 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -164,8 +164,8 @@ block: - name: debug - msg: - - Download the binary + debug: + msg: Download the binary - name: Fetch binary get_url: @@ -242,6 +242,10 @@ when: move_binary +- name: debug + debug: + msg: Install from {{ atl_product_download }} + # At this point the binary is in place and can be used to install # The location is determined by {{ atl_product_download }} variable # set above From 37ae0eadc5026a0afe2dce7bc40c973351a48321 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 11:10:47 +1100 Subject: [PATCH 17/37] ITOPSENG-164 Debug some changes to logic --- roles/product_install/tasks/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 349df3e..5da046f 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -240,6 +240,11 @@ when: moving_lock_removed is succeeded register: temp_deleted + - name: Set install to home_shared location + set_fact: + atl_product_download: "{{ atl_product_home_shared_download }}" + when: temp_deleted is succeeded + when: move_binary - name: debug From 5f2e5929ab3f48305f3d41d316a5ea95f23cf4e0 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Tue, 15 Oct 2019 15:27:41 +1100 Subject: [PATCH 18/37] ITOPSENG-164 Remove all the debug now that logic is fixed --- roles/product_install/tasks/main.yml | 32 ++++++++-------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 5da046f..068a3ee 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -163,10 +163,7 @@ - name: download_binary is true so fetch and do all the things block: - - name: debug - debug: - msg: Download the binary - + # Fetch binary and copy to temp - name: Fetch binary get_url: url: "{{ atl_product_download_url }}" @@ -175,7 +172,7 @@ force: false register: atl_product_completed - # If product installer was fetched make the moving directory + # If product installer was fetched make the lock directory - name: Create moving_lock. file: path: "{{ atl_product_home_shared_moving_lock }}" @@ -184,26 +181,20 @@ - atl_product_completed is succeeded register: moving_lock_created - # Directory lock was created by this run - # - Move binary + # Directory lock was created by this run? + # If so, then set a fact intending to move binary - name: Move binary Scenario - lock created by this run set_fact: move_binary: true when: - moving_lock_created is succeeded - moving_lock_created.changed == True - - # Directory lock was either already created or could not be - # - Continue and install from temp - - name: Continue Scenario - lock cannot be created or created by previous run - debug: - msg: lock not created - when: moving_lock_created is not succeeded or - ( moving_lock_created is succeeded and moving_lock_created.changed == False ) + # Otherwise directory lock was either already created or + # could not be created. Fall back is to continue and install from temp when: download_binary -# Move binary block +# If the intention is to move binary to home_shared - name: Move product installer to home_shared block: @@ -247,13 +238,8 @@ when: move_binary -- name: debug - debug: - msg: Install from {{ atl_product_download }} - -# At this point the binary is in place and can be used to install -# The location is determined by {{ atl_product_download }} variable -# set above +# At this point the binary is in {{ atl_product_download }} +# (which is either on home_shared or temp) - name: Unpack the downloaded application depending on format include_tasks: "unpack_{{ atl_download_format }}.yml" From 1dedfa827e116cb4a5ea5d960857f6a7d880b106 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Wed, 16 Oct 2019 14:37:05 +1100 Subject: [PATCH 19/37] ITOPSENG-164 yamllint fixes --- roles/product_install/tasks/main.yml | 118 +++++++++++++-------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 068a3ee..388164c 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -163,34 +163,34 @@ - name: download_binary is true so fetch and do all the things block: - # Fetch binary and copy to temp - - name: Fetch binary - get_url: - url: "{{ atl_product_download_url }}" - dest: "{{ atl_product_temp_download }}" - mode: 0755 - force: false - register: atl_product_completed + # Fetch binary and copy to temp + - name: Fetch binary + get_url: + url: "{{ atl_product_download_url }}" + dest: "{{ atl_product_temp_download }}" + mode: 0755 + force: false + register: atl_product_completed - # If product installer was fetched make the lock directory - - name: Create moving_lock. - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: directory - when: - - atl_product_completed is succeeded - register: moving_lock_created + # If product installer was fetched make the lock directory + - name: Create moving_lock. + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: directory + when: + - atl_product_completed is succeeded + register: moving_lock_created - # Directory lock was created by this run? - # If so, then set a fact intending to move binary - - name: Move binary Scenario - lock created by this run - set_fact: - move_binary: true - when: - - moving_lock_created is succeeded - - moving_lock_created.changed == True - # Otherwise directory lock was either already created or - # could not be created. Fall back is to continue and install from temp + # Directory lock was created by this run? + # If so, then set a fact intending to move binary + - name: Move binary Scenario - lock created by this run + set_fact: + move_binary: true + when: + - moving_lock_created is succeeded + - moving_lock_created.changed == True + # Otherwise directory lock was either already created or + # could not be created. Fall back is to continue and install from temp when: download_binary @@ -198,43 +198,43 @@ - name: Move product installer to home_shared block: - - name: Copy temp installer to home_shared - copy: - src: "{{ atl_product_temp_download }}" - dest: "{{ atl_product_home_shared_download }}" - remote_src: true - when: - - moving_lock_created is succeeded - - moving_lock_created.changed == True - register: copied + - name: Copy temp installer to home_shared + copy: + src: "{{ atl_product_temp_download }}" + dest: "{{ atl_product_home_shared_download }}" + remote_src: true + when: + - moving_lock_created is succeeded + - moving_lock_created.changed == True + register: copied - - name: Create completed_lock once product installer downloaded and copied - file: - path: "{{ atl_product_home_shared_completed_lock }}" - state: directory - when: copied is succeeded - register: completed_lock_created + - name: Create completed_lock once product installer downloaded and copied + file: + path: "{{ atl_product_home_shared_completed_lock }}" + state: directory + when: copied is succeeded + register: completed_lock_created - - name: Remove moving_lock to show that binary is completed - file: - path: "{{ atl_product_home_shared_moving_lock }}" - state: absent - when: - - completed_lock_created is succeeded - - copied is succeeded - register: moving_lock_removed + - name: Remove moving_lock to show that binary is completed + file: + path: "{{ atl_product_home_shared_moving_lock }}" + state: absent + when: + - completed_lock_created is succeeded + - copied is succeeded + register: moving_lock_removed - - name: Delete old temp installer - file: - path: "{{ atl_product_temp_download }}" - state: absent - when: moving_lock_removed is succeeded - register: temp_deleted + - name: Delete old temp installer + file: + path: "{{ atl_product_temp_download }}" + state: absent + when: moving_lock_removed is succeeded + register: temp_deleted - - name: Set install to home_shared location - set_fact: - atl_product_download: "{{ atl_product_home_shared_download }}" - when: temp_deleted is succeeded + - name: Set install to home_shared location + set_fact: + atl_product_download: "{{ atl_product_home_shared_download }}" + when: temp_deleted is succeeded when: move_binary From f24fb3fb6574b9acda4e2ccffeed557eb42063cd Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Wed, 16 Oct 2019 14:45:50 +1100 Subject: [PATCH 20/37] ITOPSENG-164 ansible-lint fixes --- roles/product_install/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 388164c..f136128 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -188,7 +188,7 @@ move_binary: true when: - moving_lock_created is succeeded - - moving_lock_created.changed == True + - moving_lock_created.changed # Otherwise directory lock was either already created or # could not be created. Fall back is to continue and install from temp @@ -205,7 +205,7 @@ remote_src: true when: - moving_lock_created is succeeded - - moving_lock_created.changed == True + - moving_lock_created.changed register: copied - name: Create completed_lock once product installer downloaded and copied From 2d2fa39cbe31ba6a09f21537391baf4247d74557 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Thu, 31 Oct 2019 16:28:05 +1100 Subject: [PATCH 21/37] ITOPSENG-164 Testing change to molecule tests --- .../molecule/bitbucket_latest/tests/test_default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index 55c71c6..4229b1f 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -37,6 +37,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/bitbucket.' + upstream + '-x64.bin') + installer = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin') assert installer.exists assert installer.user == 'root' From 6e99ec440fe1eb4e30a9a37c17abb128ffcf3378 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Thu, 31 Oct 2019 16:40:26 +1100 Subject: [PATCH 22/37] Revert "ITOPSENG-164 Testing change to molecule tests" This reverts commit 2d2fa39cbe31ba6a09f21537391baf4247d74557. --- .../molecule/bitbucket_latest/tests/test_default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index 4229b1f..55c71c6 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -37,6 +37,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin') + installer = host.file('/opt/atlassian/tmp/bitbucket.' + upstream + '-x64.bin') assert installer.exists assert installer.user == 'root' From 36f870f20096567dab33c37cfe300dcadd6f8dda Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 10:57:06 +1100 Subject: [PATCH 23/37] ITOPSENG-164 Testing changes --- .../molecule/bitbucket_latest/tests/test_default.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index 55c71c6..ed87338 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -37,6 +37,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/bitbucket.' + upstream + '-x64.bin') + installer = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin') assert installer.exists - assert installer.user == 'root' + assert installer.user == 'root' From c015984acec4d9aa5ad9ae49e595f7e1d4041453 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 11:32:38 +1100 Subject: [PATCH 24/37] ITOPSENG-164 Testing changes --- .../molecule/confluence_latest/tests/test_default.py | 2 +- roles/product_install/molecule/default/tests/test_default.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/product_install/molecule/confluence_latest/tests/test_default.py b/roles/product_install/molecule/confluence_latest/tests/test_default.py index 47245a4..0b6c684 100644 --- a/roles/product_install/molecule/confluence_latest/tests/test_default.py +++ b/roles/product_install/molecule/confluence_latest/tests/test_default.py @@ -35,6 +35,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/confluence.'+upstream+'-x64.bin') + installer = host.file('/media/atl/confluence/shared-home/downloads/confluence.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/default/tests/test_default.py b/roles/product_install/molecule/default/tests/test_default.py index 70839b9..08626e3 100644 --- a/roles/product_install/molecule/default/tests/test_default.py +++ b/roles/product_install/molecule/default/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+'-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' From 788bbd93dda7173131f30cd08169faecd9184ef5 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 11:58:31 +1100 Subject: [PATCH 25/37] ITOPSENG-164 Testing changes --- .../molecule/jira_version_latest/tests/test_default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_install/molecule/jira_version_latest/tests/test_default.py b/roles/product_install/molecule/jira_version_latest/tests/test_default.py index 70839b9..08626e3 100644 --- a/roles/product_install/molecule/jira_version_latest/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_latest/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+'-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' From 8022b591573967fcb1e2773757f8d1d466504210 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 12:06:08 +1100 Subject: [PATCH 26/37] ITOPS-2158 testing --- .../product_install/molecule/jira_tarball/tests/test_default.py | 2 +- .../molecule/jira_version_from_file/tests/test_default.py | 2 +- .../molecule/jira_version_override/tests/test_default.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 2f5d09b..d534aa5 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+'.tar.gz') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'.tar.gz') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/jira_version_from_file/tests/test_default.py b/roles/product_install/molecule/jira_version_from_file/tests/test_default.py index 5f00577..902b5f5 100644 --- a/roles/product_install/molecule/jira_version_from_file/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_from_file/tests/test_default.py @@ -14,7 +14,7 @@ def test_version_is_correct(host): 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-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.7.9.0-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/jira_version_override/tests/test_default.py b/roles/product_install/molecule/jira_version_override/tests/test_default.py index 8b5c7a4..c2e28c5 100644 --- a/roles/product_install/molecule/jira_version_override/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_override/tests/test_default.py @@ -14,7 +14,7 @@ def test_version_is_correct(host): 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-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.7.13.2-x64.bin') assert installer.exists assert installer.user == 'root' From 17366378de4895b2dd6aa28ea16fdf95cc63b799 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 12:22:50 +1100 Subject: [PATCH 27/37] ITOPS-2158 testing --- .../molecule/jira_cached_with_downgrade/tests/test_default.py | 2 +- .../molecule/jira_cached_with_upgrade/tests/test_default.py | 2 +- .../molecule/jira_software_latest/tests/test_default.py | 2 +- .../product_install/molecule/servicedesk3/tests/test_default.py | 2 +- .../product_install/molecule/servicedesk4/tests/test_default.py | 2 +- .../molecule/servicedesk_latest/tests/test_default.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py b/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py index 05a6bb3..aad72bf 100644 --- a/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py +++ b/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py @@ -14,7 +14,7 @@ def test_version_is_correct(host): assert verfile.content.decode("UTF-8").strip() == "7.10.2" def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/jira-core.7.10.2-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.7.10.2-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py b/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py index ead6adf..c828961 100644 --- a/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py +++ b/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py @@ -14,7 +14,7 @@ def test_version_is_correct(host): assert verfile.content.decode("UTF-8").strip() == "7.10.1" def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/jira-core.7.10.1-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-core.7.10.1-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/jira_software_latest/tests/test_default.py b/roles/product_install/molecule/jira_software_latest/tests/test_default.py index 63451c8..9a5b161 100644 --- a/roles/product_install/molecule/jira_software_latest/tests/test_default.py +++ b/roles/product_install/molecule/jira_software_latest/tests/test_default.py @@ -35,6 +35,6 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/opt/atlassian/tmp/jira-software.'+upstream+'-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/jira-software.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/servicedesk3/tests/test_default.py b/roles/product_install/molecule/servicedesk3/tests/test_default.py index 24afb62..ed19b29 100644 --- a/roles/product_install/molecule/servicedesk3/tests/test_default.py +++ b/roles/product_install/molecule/servicedesk3/tests/test_default.py @@ -14,7 +14,7 @@ def test_version_is_correct(host): assert verfile.content.decode("UTF-8").strip() == "3.9.0" def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/servicedesk.3.9.0-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/servicedesk.3.9.0-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/servicedesk4/tests/test_default.py b/roles/product_install/molecule/servicedesk4/tests/test_default.py index b660f23..e7d1179 100644 --- a/roles/product_install/molecule/servicedesk4/tests/test_default.py +++ b/roles/product_install/molecule/servicedesk4/tests/test_default.py @@ -14,7 +14,7 @@ def test_version_is_correct(host): assert verfile.content.decode("UTF-8").strip() == "4.1.0" def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/servicedesk.4.1.0-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/servicedesk.4.1.0-x64.bin') assert installer.exists assert installer.user == 'root' diff --git a/roles/product_install/molecule/servicedesk_latest/tests/test_default.py b/roles/product_install/molecule/servicedesk_latest/tests/test_default.py index 2190295..ee855e3 100644 --- a/roles/product_install/molecule/servicedesk_latest/tests/test_default.py +++ b/roles/product_install/molecule/servicedesk_latest/tests/test_default.py @@ -23,7 +23,7 @@ def test_version_is_correct(host): assert verfile.content.decode("UTF-8").strip() == sd def test_is_downloaded(host): - installer = host.file('/opt/atlassian/tmp/servicedesk.'+sd+'-x64.bin') + installer = host.file('/media/atl/jira/shared/downloads/servicedesk.'+sd+'-x64.bin') assert installer.exists assert installer.user == 'root' From e55593bf6c50171a8618bbe89b0f77905a2860a9 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 13:35:30 +1100 Subject: [PATCH 28/37] ITOPS-2158 testing --- .../molecule/bitbucket_latest/tests/test_default.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index ed87338..6c28b1b 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -39,4 +39,8 @@ def test_latest_is_downloaded(host): installer = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin') assert installer.exists - assert installer.user == 'root' + assert installer.user == 'root' + +def test_completed_lockfile(host): + verfile = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin_completed') + assert verfile.exists From ae673495276cdd1c7068458e305c352e212a7fc0 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 13:51:16 +1100 Subject: [PATCH 29/37] ITOPS-2158 testing --- .../molecule/bitbucket_latest/tests/test_default.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index 6c28b1b..c709022 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -42,5 +42,10 @@ def test_latest_is_downloaded(host): assert installer.user == 'root' def test_completed_lockfile(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'] + verfile = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin_completed') assert verfile.exists From c10b312148f373fff987d48858dbeb3925e7643c Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 14:52:57 +1100 Subject: [PATCH 30/37] ITOPS-2158 Remaining molecule unit tests --- .../molecule/bitbucket_latest/tests/test_default.py | 7 ++++--- .../molecule/confluence_latest/tests/test_default.py | 9 +++++++++ .../molecule/default/tests/test_default.py | 9 +++++++++ .../jira_cached_with_downgrade/tests/test_default.py | 5 +++++ .../jira_cached_with_upgrade/tests/test_default.py | 5 +++++ .../molecule/jira_software_latest/tests/test_default.py | 9 +++++++++ .../molecule/jira_tarball/tests/test_default.py | 9 +++++++++ .../jira_version_from_file/tests/test_default.py | 5 +++++ .../molecule/jira_version_latest/tests/test_default.py | 9 +++++++++ .../molecule/jira_version_override/tests/test_default.py | 5 +++++ .../molecule/servicedesk3/tests/test_default.py | 5 +++++ .../molecule/servicedesk4/tests/test_default.py | 5 +++++ .../molecule/servicedesk_latest/tests/test_default.py | 5 +++++ 13 files changed, 84 insertions(+), 3 deletions(-) diff --git a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py index c709022..bbd851d 100644 --- a/roles/product_install/molecule/bitbucket_latest/tests/test_default.py +++ b/roles/product_install/molecule/bitbucket_latest/tests/test_default.py @@ -46,6 +46,7 @@ def test_completed_lockfile(host): "https://marketplace.atlassian.com/rest/2/applications/bitbucket/versions/latest") upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - - verfile = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin_completed') - assert verfile.exists + + lockfile = host.file('/media/atl/bitbucket/shared/downloads/bitbucket.' + upstream + '-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' diff --git a/roles/product_install/molecule/confluence_latest/tests/test_default.py b/roles/product_install/molecule/confluence_latest/tests/test_default.py index 0b6c684..7ec072b 100644 --- a/roles/product_install/molecule/confluence_latest/tests/test_default.py +++ b/roles/product_install/molecule/confluence_latest/tests/test_default.py @@ -38,3 +38,12 @@ def test_latest_is_downloaded(host): installer = host.file('/media/atl/confluence/shared-home/downloads/confluence.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' + +def test_completed_lockfile(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'] + + lockfile = host.file('/media/atl/confluence/shared-home/downloads/confluence.'+upstream+'-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' diff --git a/roles/product_install/molecule/default/tests/test_default.py b/roles/product_install/molecule/default/tests/test_default.py index 08626e3..930ab59 100644 --- a/roles/product_install/molecule/default/tests/test_default.py +++ b/roles/product_install/molecule/default/tests/test_default.py @@ -26,3 +26,12 @@ def test_latest_is_downloaded(host): installer = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' + +def test_completed_lockfile(host): + upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest") + upstream_json = json.load(upstream_fd) + upstream = upstream_json['version'] + + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' \ No newline at end of file diff --git a/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py b/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py index aad72bf..788c3de 100644 --- a/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py +++ b/roles/product_install/molecule/jira_cached_with_downgrade/tests/test_default.py @@ -18,6 +18,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.7.10.2-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-core/7.10.2/atlassian-jira/') assert installer.exists diff --git a/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py b/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py index c828961..0818e1b 100644 --- a/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py +++ b/roles/product_install/molecule/jira_cached_with_upgrade/tests/test_default.py @@ -18,6 +18,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.7.10.1-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-core/7.10.1/atlassian-jira/') assert installer.exists diff --git a/roles/product_install/molecule/jira_software_latest/tests/test_default.py b/roles/product_install/molecule/jira_software_latest/tests/test_default.py index 9a5b161..de1dca3 100644 --- a/roles/product_install/molecule/jira_software_latest/tests/test_default.py +++ b/roles/product_install/molecule/jira_software_latest/tests/test_default.py @@ -38,3 +38,12 @@ def test_latest_is_downloaded(host): installer = host.file('/media/atl/jira/shared/downloads/jira-software.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' + +def test_completed_lockfile(host): + upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest") + upstream_json = json.load(upstream_fd) + upstream = upstream_json['version'] + + lockfile = host.file('/media/atl/jira/shared/downloads/jira-software.'+upstream+'-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' \ No newline at end of file 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 d534aa5..11a7438 100644 --- a/roles/product_install/molecule/jira_tarball/tests/test_default.py +++ b/roles/product_install/molecule/jira_tarball/tests/test_default.py @@ -26,3 +26,12 @@ def test_latest_is_downloaded(host): installer = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'.tar.gz') assert installer.exists assert installer.user == 'root' + +def test_completed_lockfile(host): + upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest") + upstream_json = json.load(upstream_fd) + upstream = upstream_json['version'] + + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'.tar.gz_completed') + assert lockfile.exists + assert lockfile.user == 'root' \ No newline at end of file diff --git a/roles/product_install/molecule/jira_version_from_file/tests/test_default.py b/roles/product_install/molecule/jira_version_from_file/tests/test_default.py index 902b5f5..b8a1966 100644 --- a/roles/product_install/molecule/jira_version_from_file/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_from_file/tests/test_default.py @@ -18,6 +18,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.7.9.0-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-core/7.9.0/atlassian-jira/') assert installer.exists diff --git a/roles/product_install/molecule/jira_version_latest/tests/test_default.py b/roles/product_install/molecule/jira_version_latest/tests/test_default.py index 08626e3..930ab59 100644 --- a/roles/product_install/molecule/jira_version_latest/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_latest/tests/test_default.py @@ -26,3 +26,12 @@ def test_latest_is_downloaded(host): installer = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'-x64.bin') assert installer.exists assert installer.user == 'root' + +def test_completed_lockfile(host): + upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/jira/versions/latest") + upstream_json = json.load(upstream_fd) + upstream = upstream_json['version'] + + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.'+upstream+'-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' \ No newline at end of file diff --git a/roles/product_install/molecule/jira_version_override/tests/test_default.py b/roles/product_install/molecule/jira_version_override/tests/test_default.py index c2e28c5..3f16801 100644 --- a/roles/product_install/molecule/jira_version_override/tests/test_default.py +++ b/roles/product_install/molecule/jira_version_override/tests/test_default.py @@ -18,6 +18,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/jira-core.7.13.2-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-core/7.13.2') assert installer.exists diff --git a/roles/product_install/molecule/servicedesk3/tests/test_default.py b/roles/product_install/molecule/servicedesk3/tests/test_default.py index ed19b29..5f50b6e 100644 --- a/roles/product_install/molecule/servicedesk3/tests/test_default.py +++ b/roles/product_install/molecule/servicedesk3/tests/test_default.py @@ -18,6 +18,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/servicedesk.3.9.0-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-servicedesk/3.9.0') assert installer.exists diff --git a/roles/product_install/molecule/servicedesk4/tests/test_default.py b/roles/product_install/molecule/servicedesk4/tests/test_default.py index e7d1179..5a22e8c 100644 --- a/roles/product_install/molecule/servicedesk4/tests/test_default.py +++ b/roles/product_install/molecule/servicedesk4/tests/test_default.py @@ -18,6 +18,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/servicedesk.4.1.0-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-servicedesk/4.1.0') assert installer.exists diff --git a/roles/product_install/molecule/servicedesk_latest/tests/test_default.py b/roles/product_install/molecule/servicedesk_latest/tests/test_default.py index ee855e3..cd975f3 100644 --- a/roles/product_install/molecule/servicedesk_latest/tests/test_default.py +++ b/roles/product_install/molecule/servicedesk_latest/tests/test_default.py @@ -27,6 +27,11 @@ def test_is_downloaded(host): assert installer.exists assert installer.user == 'root' +def test_completed_lockfile(host): + lockfile = host.file('/media/atl/jira/shared/downloads/servicedesk.'+sd+'-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' + def test_is_unpacked(host): installer = host.file('/opt/atlassian/jira-servicedesk/'+sd) assert installer.exists From d7ef24eaa94ffdf08f1f055fc0d2699e0ee360b0 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 15:27:17 +1100 Subject: [PATCH 31/37] ITOPS-2158 Added latest crowd molecule test --- .../molecule/crowd_latest/Dockerfile.j2 | 14 ++++++ .../molecule/crowd_latest/molecule.yml | 30 ++++++++++++ .../molecule/crowd_latest/playbook.yml | 11 +++++ .../crowd_latest/tests/test_default.py | 49 +++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 roles/product_install/molecule/crowd_latest/Dockerfile.j2 create mode 100644 roles/product_install/molecule/crowd_latest/molecule.yml create mode 100644 roles/product_install/molecule/crowd_latest/playbook.yml create mode 100644 roles/product_install/molecule/crowd_latest/tests/test_default.py diff --git a/roles/product_install/molecule/crowd_latest/Dockerfile.j2 b/roles/product_install/molecule/crowd_latest/Dockerfile.j2 new file mode 100644 index 0000000..e6aa95d --- /dev/null +++ b/roles/product_install/molecule/crowd_latest/Dockerfile.j2 @@ -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 diff --git a/roles/product_install/molecule/crowd_latest/molecule.yml b/roles/product_install/molecule/crowd_latest/molecule.yml new file mode 100644 index 0000000..7fd3163 --- /dev/null +++ b/roles/product_install/molecule/crowd_latest/molecule.yml @@ -0,0 +1,30 @@ +--- +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/product_install/molecule/crowd_latest/playbook.yml b/roles/product_install/molecule/crowd_latest/playbook.yml new file mode 100644 index 0000000..3373f8a --- /dev/null +++ b/roles/product_install/molecule/crowd_latest/playbook.yml @@ -0,0 +1,11 @@ +--- +- name: Converge + hosts: all + vars: + atl_product_family: "crowd" + atl_product_edition: "crowd" + atl_product_user: "crowd" + roles: + - role: linux_common + - role: product_common + - role: product_install diff --git a/roles/product_install/molecule/crowd_latest/tests/test_default.py b/roles/product_install/molecule/crowd_latest/tests/test_default.py new file mode 100644 index 0000000..64c8b58 --- /dev/null +++ b/roles/product_install/molecule/crowd_latest/tests/test_default.py @@ -0,0 +1,49 @@ +import os +from six.moves import urllib +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/crowd/shared/crowd.version') + assert verfile.exists + +def test_symlink_created(host): + target = host.file('/opt/atlassian/crowd/current') + assert target.exists + assert target.is_symlink + +def test_unpacked(host): + verfile = host.file('/opt/atlassian/crowd/current/bin/catalina.sh') + assert verfile.exists + +def test_version_file_is_latest(host): + verfile = host.file('/media/atl/crowd/shared/crowd.version') + assert verfile.exists + + upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/crowd/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/crowd/versions/latest") + upstream_json = json.load(upstream_fd) + upstream = upstream_json['version'] + + installer = host.file('/media/atl/crowd/shared/downloads/crowd.'+upstream+'-x64.bin') + assert installer.exists + assert installer.user == 'root' + +def test_completed_lockfile(host): + upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest") + upstream_json = json.load(upstream_fd) + upstream = upstream_json['version'] + + lockfile = host.file('/media/atl/crowd/shared/downloads/crowd.'+upstream+'-x64.bin_completed') + assert lockfile.exists + assert lockfile.user == 'root' From 2b774cd8e67c4ccb94fbe6282da38ef0eea28c96 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 15:35:41 +1100 Subject: [PATCH 32/37] ITOPS-2158 Added latest crowd molecule test --- bitbucket-pipelines.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d28b140..11d18bd 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -259,4 +259,10 @@ pipelines: - apt-get update && ./bin/install-ansible --dev - ./bin/run-tests-in-batches --batch 29 - + - step: + name: Molecule Test Batch - 30 + services: + - docker + script: + - apt-get update && ./bin/install-ansible --dev + - ./bin/run-tests-in-batches --batch 30 From 3032a001be895e8ff84a5283048cdb65d86f0a76 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 15:42:56 +1100 Subject: [PATCH 33/37] ITOPS-2158 Added latest crowd molecule test --- bitbucket-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 11d18bd..34b84dd 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -14,7 +14,7 @@ pipelines: - step: name: Pre Parallelization stage script: - - echo "Running tests in 29 batches" + - echo "Running tests in 30 batches" - step: name: Check if number of batches match actual number of scenarios script: @@ -266,3 +266,4 @@ pipelines: script: - apt-get update && ./bin/install-ansible --dev - ./bin/run-tests-in-batches --batch 30 + From cadae8248f949f6b08ff31c0fec5f38af09446dc Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Fri, 1 Nov 2019 16:19:51 +1100 Subject: [PATCH 34/37] ITOPS-2158 Changed run_user test to be more specific --- bitbucket-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 34b84dd..408b078 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -267,3 +267,4 @@ pipelines: - apt-get update && ./bin/install-ansible --dev - ./bin/run-tests-in-batches --batch 30 + From 531fb18294afbf702cfac3b441e06434a32288bb Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Mon, 4 Nov 2019 10:39:59 +1100 Subject: [PATCH 35/37] ITOPS-2158 Changed run_user test to be more specific --- .../molecule/crowd_latest/tests/test_default.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/roles/product_install/molecule/crowd_latest/tests/test_default.py b/roles/product_install/molecule/crowd_latest/tests/test_default.py index 64c8b58..51ec463 100644 --- a/roles/product_install/molecule/crowd_latest/tests/test_default.py +++ b/roles/product_install/molecule/crowd_latest/tests/test_default.py @@ -17,33 +17,36 @@ def test_symlink_created(host): assert target.is_symlink def test_unpacked(host): - verfile = host.file('/opt/atlassian/crowd/current/bin/catalina.sh') + verfile = host.file('/opt/atlassian/crowd/current/bin/start-crowd.sh') assert verfile.exists def test_version_file_is_latest(host): verfile = host.file('/media/atl/crowd/shared/crowd.version') assert verfile.exists - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest") + upstream_fd = urllib.request.urlopen( + "https://marketplace.atlassian.com/rest/2/applications/crowd/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/crowd/versions/latest") + upstream_fd = urllib.request.urlopen( + "https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest") upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/media/atl/crowd/shared/downloads/crowd.'+upstream+'-x64.bin') + installer = host.file('/media/atl/crowd/shared/downloads/crowd.' + upstream + '-x64.bin') assert installer.exists assert installer.user == 'root' def test_completed_lockfile(host): - upstream_fd = urllib.request.urlopen("https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest") + upstream_fd = urllib.request.urlopen( + "https://marketplace.atlassian.com/rest/2/applications/crowd/versions/latest") upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - lockfile = host.file('/media/atl/crowd/shared/downloads/crowd.'+upstream+'-x64.bin_completed') + lockfile = host.file('/media/atl/crowd/shared/downloads/crowd.' + upstream + '-x64.bin_completed') assert lockfile.exists assert lockfile.user == 'root' From 952c8ac97e55830554c494d7561074b9145b6eb8 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Mon, 4 Nov 2019 11:03:56 +1100 Subject: [PATCH 36/37] ITOPS-2158 Added crowd test - testing --- .../product_install/molecule/crowd_latest/tests/test_default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/product_install/molecule/crowd_latest/tests/test_default.py b/roles/product_install/molecule/crowd_latest/tests/test_default.py index 51ec463..eb186dc 100644 --- a/roles/product_install/molecule/crowd_latest/tests/test_default.py +++ b/roles/product_install/molecule/crowd_latest/tests/test_default.py @@ -17,7 +17,7 @@ def test_symlink_created(host): assert target.is_symlink def test_unpacked(host): - verfile = host.file('/opt/atlassian/crowd/current/bin/start-crowd.sh') + verfile = host.file('/opt/atlassian/crowd/current/start_crowd.sh') assert verfile.exists def test_version_file_is_latest(host): From acfd10d2ae475347868ac6008052097aecbdf124 Mon Sep 17 00:00:00 2001 From: Glenn Stewart Date: Mon, 4 Nov 2019 11:39:08 +1100 Subject: [PATCH 37/37] ITOPS-2158 Added crowd test - testing --- roles/product_install/molecule/crowd_latest/playbook.yml | 1 + .../molecule/crowd_latest/tests/test_default.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/product_install/molecule/crowd_latest/playbook.yml b/roles/product_install/molecule/crowd_latest/playbook.yml index 3373f8a..490514e 100644 --- a/roles/product_install/molecule/crowd_latest/playbook.yml +++ b/roles/product_install/molecule/crowd_latest/playbook.yml @@ -5,6 +5,7 @@ atl_product_family: "crowd" atl_product_edition: "crowd" atl_product_user: "crowd" + atl_download_format: "tarball" roles: - role: linux_common - role: product_common diff --git a/roles/product_install/molecule/crowd_latest/tests/test_default.py b/roles/product_install/molecule/crowd_latest/tests/test_default.py index eb186dc..b75a0b5 100644 --- a/roles/product_install/molecule/crowd_latest/tests/test_default.py +++ b/roles/product_install/molecule/crowd_latest/tests/test_default.py @@ -37,7 +37,7 @@ def test_latest_is_downloaded(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - installer = host.file('/media/atl/crowd/shared/downloads/crowd.' + upstream + '-x64.bin') + installer = host.file('/media/atl/crowd/shared/downloads/crowd.' + upstream + '.tar.gz') assert installer.exists assert installer.user == 'root' @@ -47,6 +47,6 @@ def test_completed_lockfile(host): upstream_json = json.load(upstream_fd) upstream = upstream_json['version'] - lockfile = host.file('/media/atl/crowd/shared/downloads/crowd.' + upstream + '-x64.bin_completed') + lockfile = host.file('/media/atl/crowd/shared/downloads/crowd.' + upstream + '.tar.gz_completed') assert lockfile.exists assert lockfile.user == 'root'