splunk / splunk-ansible

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

change in install_apps.yml causes install to fail #496

Closed snoby closed 4 years ago

snoby commented 4 years ago

Using the 'latest' release of splunk docker container, the install of apps fails, where as when I revert back to version splunk/splunk:8.0.4-debian the install succeeds. I have tracked the error down to the latest commit here:

https://github.com/splunk/splunk-ansible/commit/eb74b3aeab63f838a30140fd5f34e36484a13403?short_path=23293e9#r39919588

The error message is:

fatal: [localhost]: FAILED! => {}

MSG:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'dest'

The error appears to be in '/opt/ansible/roles/splunk_common/tasks/install_apps.yml': line 43, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  - name: Infer app filepath
    ^ here
nwang92 commented 4 years ago

Could you share what your SPLUNK_APPS_URL/splunk.apps_location looks like?

snoby commented 4 years ago

It's the list of two apps (obviously)

docker run -d                                                       \
  -p 8000:8000                                                      \
  -p 8088:8088                                                      \
  -p 8089:8089                                                      \
  -e 'SPLUNK_START_ARGS=--accept-license'                           \
  -e 'SPLUNK_PASSWORD=password123'                                  \
  -e 'SPLUNK_APPS_URL=/tmp/lma.tgz,/tmp/splunk_httpinput.tgz'       \
  -e SPLUNK_LICENSE_URI=/tmp/License.xml                            \
  -v $PWD/license/License.xml:/tmp/License.xml:ro                   \
  -v $PWD/configs/lma.tgz:/tmp/lma.tgz:ro                           \
  -v $PWD/configs/splunk_httpinput.tgz:/tmp/splunk_httpinput.tgz:ro \
  -v $PWD/configs/default.yml/:/tmp/defaults/default.yml:ro         \
  --name=splunk                                                     \
  --hostname=splunk                                                 \
  --memory=4g                                                       \
  splunk/splunk:8.0.4-debian
nwang92 commented 4 years ago

Got it, I think it's /tmp/splunk_httpinput.tgz name breaking the simplistic jinja matching. Will shoot a fix shortly; if you need a workaround, you can probably rename splunk_httpinput.tgz to not include http and you should be set.