splunk / splunk-ansible

Ansible playbooks for configuring and managing Splunk Enterprise and Universal Forwarder deployments
355 stars 186 forks source link

docker-splunk heavy forwarder role fails to launch due to ansible bug #813

Closed alexeiser closed 4 months ago

alexeiser commented 7 months ago

The most recent docker images 9.0.9, 9.1.4 and 9.2.1 all fail with the error:

The conditional check 'not check_fwd_lic.content.json.entry[0].content.is_active' failed. The error was: error while evaluating conditional (not check_fwd_lic.content.json.entry[0].content.is_active): 'dict object' has no attribute 'content'

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

e.g. command to cause failure

docker run -it -e SPLUNK_PASSWORD=helloworld \
-e SPLUNK_ROLE=splunk_heavy_forwarder \
-e SPLUNK_START_ARGS=--accept-license \
-p 8000:8000 -p 8088:8088  -e SPLUNK_LICENSE_URI="forwarder"  splunk/splunk:9.2.1

This seems to be because https://github.com/splunk/splunk-ansible/pull/777 changed from when: not check_fwd_lic.json.entry[0].content.is_active to when: not check_fwd_lic.content.json.entry[0].content.is_active - but no other item was changed - including the free license enablement.

paheath commented 6 months ago

I don't think splunk_api and uri have matching return fields as expected.

The conditional check 'post_apps_local.status == 201' failed. The error was: error while evaluating cond
itional (post_apps_local.status == 201): 'dict object' has no attribute 'status'