Closed raggadaz closed 1 year ago
The error message you provided indicates that there is an issue with undefined variables in the Ansible playbook. Specifically, it mentions that 'splunk_install_app' is undefined. To fix this issue, you'll need to ensure that all required variables are defined and properly configured in your Ansible playbook or configuration files.
Here's a step-by-step guide to fix this issue:
Check Variable Definitions: First, review your Ansible playbook and configuration files (especially splunk_config.yml) to make sure that all the necessary variables like splunk_install_app, splunk_install_dir, splunk_home, and splunk_indexer_volumes are defined and have appropriate values.
Ensure Proper YAML Syntax: Ensure that your splunk_config.yml file has proper YAML syntax, including correct indentation. YAML is sensitive to indentation, so make sure variables and their values are indented correctly.
Variable Scoping: Check that the variables are correctly scoped. They should either be defined in your splunk_config.yml or sourced from external variables, depending on your playbook's structure.
Include/Import Files: Verify if your playbook includes or imports other Ansible files or roles. Sometimes variables are defined in these included files, so make sure they are correctly referenced.
Ansible Version Compatibility: Ensure that the Ansible version you are using is compatible with the playbook and roles you are running. Sometimes, different Ansible versions may handle variables differently.
Debugging: Use Ansible's debug module to print out the values of variables at the point where the error occurs. This can help you identify which variable is causing the issue and whether it's correctly defined at that point.
By following these steps, you should be able to identify and resolve the issue with undefined variables in your Ansible playbook. Once the variables are correctly defined and populated, your Splunk installation should proceed as expected.
Best of luck
In short, I think the playbook is calling for variable that it can't find.
You are using Ansible 2.15, which is not supported due to the bug #80944. Please always check the supported ansible versions at the end of the readme.
Please create a virtualenv and install an earlier version of ansible. I'm using version 2.14 right now.
yes this works now - thanks for the good documentation :-) will try to read it in the future completly :-)
Describe the bug I am trying to install Splunk Environement on AWS - based on the AWS Config Example. Vagrant up is working, 3 instances are coming up. ansible-playbook ansible/deploy_site.yml is going to beginn but fails a the indexer at taks check_volume pathes
error is: TASK [indexer : check volume pathes] *** fatal: [idx]: FAILED! => {"msg": "{%- set defaultpath = splunk_home+'/var/lib/splunk' -%} {%- if splunk_indexer_volumes is mapping -%}\n {%- set res = {} -%}\n {%- for volume, properties in splunk_indexer_volumes|default(dict({'primary':{}})) | dictsort -%}\n {%- if properties is not mapping -%}\n {%- set properties = {'path': defaultpath} -%}\n {%- endif -%}\n {%- if properties.storageType|default(\"local\") != \"remote\" -%}\n {%- if properties.path is not defined -%}\n {%- set ignored = properties.update({'path': defaultpath}) -%}\n {%- endif -%}\n {%- set ignored = res.update({volume: properties}) -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if res.keys()|list|length > 0 -%}\n {{ res }}\n {%- else -%}\n {{ {'primary':{'path': defaultpath}} }}\n {%- endif -%}\n{%- else -%}\n {{ {'primary':{'path': defaultpath}} }}\n{%- endif -%}: {{splunk_install_dir}}/{{splunk_install_app}}: 'splunk_install_app' is undefined. 'splunk_install_app' is undefined. {{splunk_install_dir}}/{{splunk_install_app}}: 'splunk_install_app' is undefined. 'splunk_install_app' is undefined. {%- set defaultpath = splunk_home+'/var/lib/splunk' -%} {%- if splunk_indexer_volumes is mapping -%}\n {%- set res = {} -%}\n {%- for volume, properties in splunk_indexer_volumes|default(dict({'primary':{}})) | dictsort -%}\n {%- if properties is not mapping -%}\n {%- set properties = {'path': defaultpath} -%}\n {%- endif -%}\n {%- if properties.storageType|default(\"local\") != \"remote\" -%}\n {%- if properties.path is not defined -%}\n {%- set ignored = properties.update({'path': defaultpath}) -%}\n {%- endif -%}\n {%- set ignored = res.update({volume: properties}) -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if res.keys()|list|length > 0 -%}\n {{ res }}\n {%- else -%}\n {{ {'primary':{'path': defaultpath}} }}\n {%- endif -%}\n{%- else -%}\n {{ {'primary':{'path': defaultpath}} }}\n{%- endif -%}: {{splunk_install_dir}}/{{splunk_install_app}}: 'splunk_install_app' is undefined. 'splunk_install_app' is undefined. {{splunk_install_dir}}/{{splunk_install_app}}: 'splunk_install_app' is undefined. 'splunk_install_app' is undefined"}
PLAY RECAP ***** idx : ok=107 changed=30 unreachable=0 failed=1 skipped=42 rescued=0 ignored=0 localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 sh : ok=88 changed=30 unreachable=0 failed=0 skipped=36 rescued=0 ignored=0 uf : ok=72 changed=17 unreachable=0 failed=0 skipped=44 rescued=0 ignored=0
To Reproduce Steps to reproduce the behavior:
Expected behavior expected was a running splunk on SH and IDX.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.