Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use separte set_fact for bearer token or basic auth download #844

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions roles/splunk_common/tasks/install_splunk_tgz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
when:
- splunk.build_location is match("^(https?)://.*")
- splunk.artifact_auth_user is undefined or splunk.artifact_auth_user == ""
register: download_result
until: download_result is succeeded
register: download_result_bearer
until: download_result_bearer is succeeded
retries: 5
delay: "{{ retry_delay }}"
become: yes
Expand All @@ -34,17 +34,27 @@
- splunk.build_location is match("^(https?)://.*")
- splunk.artifact_auth_user is defined
- splunk.artifact_auth_user != ""
register: download_result
until: download_result is succeeded
register: download_result_basic
until: download_result_basic is succeeded
retries: 5
delay: "{{ retry_delay }}"
become: yes
become_user: "{{ privileged_user }}"

- name: Define a path for the downloaded package
- name: Define a path for the downloaded package (bearer token)
set_fact:
splunk_downloaded_build_location: "{{ download_result.dest }}"
when: splunk.build_location is match("^(https?)://.*")
splunk_downloaded_build_location: "{{ download_result_bearer.dest }}"
when:
- splunk.build_location is match("^(https?)://.*")
- splunk.artifact_auth_user is undefined or splunk.artifact_auth_user == ""

- name: Define a path for the downloaded package (basic auth)
set_fact:
splunk_downloaded_build_location: "{{ download_result_basic.dest }}"
when:
- splunk.build_location is match("^(https?)://.*")
- splunk.artifact_auth_user is defined
- splunk.artifact_auth_user != ""

- name: Define a regex replacement for splunk.build_location
set_fact:
Expand Down