From d8586946986efa5ef65c70418e818a1c2282e1e5 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 14:04:44 +1100 Subject: [PATCH 1/7] ITOPSENG-395 allowing for a version to be forced (to handle milestone/beta builds) --- roles/product_install/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 81cf0d0..ea1e85a 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -77,7 +77,8 @@ set_fact: atl_download_version: "{{ atl_product_version }}" when: (not cached.stat.exists) or - atl_product_version is version(atl_cached_version, '>') + atl_product_version is version(atl_cached_version, '>') or + force_version_update is defined - name: "Case: Cached version is higher, ignore supplied" set_fact: From 0b3da911e4926884f22e5061b6b1a5eb224687ee Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 14:21:37 +1100 Subject: [PATCH 2/7] ITOPSENG-395 more robust checking of the force upgrade --- 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 ea1e85a..d2ef758 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -73,12 +73,12 @@ - name: "Case: Version is not latest" block: - - name: "Case: No cached version, or but supplied is higher; use supplied" + - name: "Case: No cached version, or but supplied is higher or forced; use supplied" set_fact: atl_download_version: "{{ atl_product_version }}" when: (not cached.stat.exists) or atl_product_version is version(atl_cached_version, '>') or - force_version_update is defined + force_version_update is defined and force_version_update | bool - name: "Case: Cached version is higher, ignore supplied" set_fact: From 528b4ff219acb9d0fab33e4c8422c43600fe596e Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 15:00:30 +1100 Subject: [PATCH 3/7] ITOPSENG-395 reordering conditionals --- roles/product_install/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index d2ef758..ecec6c4 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -76,9 +76,9 @@ - name: "Case: No cached version, or but supplied is higher or forced; use supplied" set_fact: atl_download_version: "{{ atl_product_version }}" - when: (not cached.stat.exists) or - atl_product_version is version(atl_cached_version, '>') or - force_version_update is defined and force_version_update | bool + when: (force_version_update is defined and force_version_update | bool) or + (not cached.stat.exists) or + atl_product_version is version(atl_cached_version, '>') - name: "Case: Cached version is higher, ignore supplied" set_fact: From f8f3cec9c2d65431e25ad1760597b2301706499a Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 15:22:18 +1100 Subject: [PATCH 4/7] ITOPSENG-395 adjusting conditionals --- roles/product_install/tasks/main.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index ecec6c4..d595495 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -73,18 +73,19 @@ - name: "Case: Version is not latest" block: - - name: "Case: No cached version, or but supplied is higher or forced; use supplied" + - name: "Case: No cached version, or supplied is higher; use supplied" set_fact: atl_download_version: "{{ atl_product_version }}" - when: (force_version_update is defined and force_version_update | bool) or - (not cached.stat.exists) or + when: (not cached.stat.exists) or atl_product_version is version(atl_cached_version, '>') - - name: "Case: Cached version is higher, ignore supplied" + - name: "Case: Cached version is higher or forced, ignore supplied" set_fact: atl_download_version: "{{ atl_cached_version }}" - when: cached.stat.exists and - atl_product_version is version(atl_cached_version, '<=') + when: + - cached.stat.exists + - atl_product_version is version(atl_cached_version, '<=') + - (not force_version_update is defined or not force_version_update | bool) when: not version_is_latest From 3f04a8c6a85c75eea19b16e82d112eb008382515 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 15:24:24 +1100 Subject: [PATCH 5/7] ITOPSENG-395 adjusting conditionals --- roles/product_install/tasks/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index d595495..6194164 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -76,16 +76,16 @@ - name: "Case: No cached version, or supplied is higher; use supplied" set_fact: atl_download_version: "{{ atl_product_version }}" - when: (not cached.stat.exists) or + when: (force_version_update is defined and force_version_update | bool) or + (not cached.stat.exists) or atl_product_version is version(atl_cached_version, '>') - name: "Case: Cached version is higher or forced, ignore supplied" set_fact: atl_download_version: "{{ atl_cached_version }}" - when: - - cached.stat.exists - - atl_product_version is version(atl_cached_version, '<=') - - (not force_version_update is defined or not force_version_update | bool) + when: cached.stat.exists and + atl_product_version is version(atl_cached_version, '<=') and + (not force_version_update is defined or not force_version_update | bool) when: not version_is_latest From 338f3b4e556dadfc4e299d6842b8499e6fd78883 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 17:05:17 +1100 Subject: [PATCH 6/7] ITOPSENG-395 adding defaults based on PR feedback --- roles/product_install/defaults/main.yml | 2 ++ roles/product_install/tasks/main.yml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 6a9940e..ceba1b4 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -37,3 +37,5 @@ atl_servicedesk_url_map: atl_servicedesk_metadata_url: "{{ atl_servicedesk_url_map[atl_product_version] | default(atl_servicedesk_url_map['default']) }}" atl_servicedesk_download_file: "{{ atl_installer_temp }}/jira-servicedesk.{{ atl_product_version }}.obr" + +force_version_update: false \ No newline at end of file diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 6194164..1907a63 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -76,8 +76,8 @@ - name: "Case: No cached version, or supplied is higher; use supplied" set_fact: atl_download_version: "{{ atl_product_version }}" - when: (force_version_update is defined and force_version_update | bool) or - (not cached.stat.exists) or + when: force_version_update | bool or + not cached.stat.exists or atl_product_version is version(atl_cached_version, '>') - name: "Case: Cached version is higher or forced, ignore supplied" @@ -85,7 +85,7 @@ atl_download_version: "{{ atl_cached_version }}" when: cached.stat.exists and atl_product_version is version(atl_cached_version, '<=') and - (not force_version_update is defined or not force_version_update | bool) + not force_version_update | bool when: not version_is_latest From 8cc637760ce4838f1cba6822790a4ba4e2663376 Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Fri, 17 Jan 2020 20:25:52 +1100 Subject: [PATCH 7/7] ITOPSENG-395 fixing linter issue --- 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 ceba1b4..72f5637 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -38,4 +38,4 @@ atl_servicedesk_metadata_url: "{{ atl_servicedesk_url_map[atl_product_version] | atl_servicedesk_download_file: "{{ atl_installer_temp }}/jira-servicedesk.{{ atl_product_version }}.obr" -force_version_update: false \ No newline at end of file +force_version_update: false