Skip to content

Conversation

@jrigassio-splunk
Copy link
Contributor

@jrigassio-splunk jrigassio-splunk commented Jan 24, 2020

Makes indexer and search head pass4SymmKey values match the randomly generated indexer and search head secrets in the event that neither are present. Resolves a test failure in develop as a result of a change to splunk-ansible.

splunk_hec_token = os.environ.get("SPLUNK_HEC_TOKEN", None)
splunk_password = os.environ.get("SPLUNK_PASSWORD", None)
splunk_idxc_secret = os.environ.get("SPLUNK_IDXC_SECRET", None)
splunk_idxc_pass4SymmKey = os.environ.get("SPLUNK_SHC_PASS4SYMMKEY", None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be SPLUNK_IDXC_PASS4SYMMKEY

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not splunk_idxc_secret:
os.environ["SPLUNK_IDXC_SECRET"] = random_generator()
if not splunk_idxc_pass4SymmKey:
os.environ["SPLUNK_IDXC_SECRET"] = os.environ["SPLUNK_IDXC_SECRET"]
Copy link
Contributor

@nwang92 nwang92 Jan 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this more, maybe this section should first check splunk_idxc_pass4SymmKey, that way when do deprecate the old variable in the splunk-ansible code, we don't need to modify this script again. Something like

if splunk_idxc_pass4SymmKey:
    os.environ["SPLUNK_IDXC_PASS4SYMMKEY"] = os.environ["SPLUNK_IDXC_SECRET"] = splunk_idxc_pass4SymmKey
elif splunk_idxc_secret:
    os.environ["SPLUNK_IDXC_PASS4SYMMKEY"] = os.environ["SPLUNK_IDXC_SECRET"] = splunk_idxc_secret
else:
   # generate random

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@nwang92 nwang92 merged commit ebf52fc into develop Jan 25, 2020
@nwang92 nwang92 deleted the pass4SymmKey-test-fix branch January 25, 2020 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants