diff --git a/roles/splunk_common/tasks/get_facts.yml b/roles/splunk_common/tasks/get_facts.yml index 60cd424d..fd7c07b3 100644 --- a/roles/splunk_common/tasks/get_facts.yml +++ b/roles/splunk_common/tasks/get_facts.yml @@ -69,15 +69,15 @@ - name: "Set current version fact" set_fact: - splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') if (manifests.matched == 1) else '0' }}" - splunk_current_build_hash: "{{ manifests.files[0].path | regex_search(regexp, '\\3') if (manifests.matched == 1) else '0' }}" - splunk_target_build_hash: "{{ splunk.build_location | string | regex_search(regexp, '\\3') | default('0') }}" + splunk_current_version: "{{ manifests.files[0].path | regex_search(regexp, '\\1') | first if (manifests.matched == 1) else '0' }}" + splunk_current_build_hash: "{{ manifests.files[0].path | regex_search(regexp, '\\3') | first if (manifests.matched == 1) else '0' }}" + splunk_target_build_hash: "{{ splunk.build_location | string | regex_search(regexp, '\\3') | first | default('0') }}" vars: regexp: 'splunk\D*?-(\d+\.\d+\.\d+(\.\d+)?)-(.*?)-.*?' - name: "Determine if Splunk has preinstall checks" set_fact: - splunk_preinstall: "{{ splunk_target_version | first is version('9.4.0', '>=') }}" + splunk_preinstall: "{{ splunk_target_version is version('9.4.0', '>=') }}" when: splunk_target_version is defined and splunk_target_version | length > 0 # We are upgrading if it is not a fresh installation and the current version is different from the target version,