splunk / splunk-ansible

Ansible playbooks for configuring and managing Splunk Enterprise and Universal Forwarder deployments
353 stars 185 forks source link

SPLUNK_LICENSE_MASTER_URL uses the protocol & management port from the local Splunk instance #383

Closed tmartin14 closed 4 years ago

tmartin14 commented 4 years ago

When setting up a docker instance to use a license master, the SPLUNK_LICENSE_MASTER_URL setting only allows for the hostname or ip address of the server. The underlying code assumes the protocol and port to be used for the connection are the same as the local instance.

The current code resides in https://github.com/splunk/splunk-ansible/blob/develop/roles/splunk_common/tasks/set_as_license_slave.yml:

Potential fixes could be either providing separate variables or simply allow the SPLUNK_LICENSE_MASTER_URL to include ://:.

Sample invocation:

docker run -t --name=splunk_test -d -p 8000:8000 -p 8088:8088 \
  -e "SPLUNK_START_ARGS=--accept-license" \
  -e "SPLUNK_PASSWORD=<password>" \
  -e "SPLUNK_LICENSE_MASTER_URL=xx.xx.xxxxxxxx.xx" \
  -e "SPLUNK_ROLE=splunk_standalone" \ 
  splunk/splunk:latest
nwang92 commented 4 years ago

Sorry it's taken a while to address this - we'll see if we can squeeze this into the next sprint cycle.

I think we can probably make some adaptability for protocol/scheme and port, ala something like:

-e SPLUNK_LICENSE_MASTER_URL=http://license-master:8080
nwang92 commented 4 years ago

The inherent problem of passwords expected to be the same will still exist though - see https://github.com/splunk/splunk-ansible/issues/222 or https://github.com/splunk/splunk-ansible/issues/206.

nwang92 commented 4 years ago

This will be out in the >=8.0.5 image set