You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know I used this in the past on our last SHC, but this time it failed with the following error (after taking off no_log). This is possibly an ansible bug because I know we've upgraded the version of ansible on our control node since the last time we built a SHC.
fatal: [splunk-sh-p01]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'splunk_mgmt_uri'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'splunk_mgmt_uri'\n\nThe error appears to be in '/home/vagrant/.ansible/roles/ansible-role-for-splunk/tasks/configure_shc_captain.yml': line 23, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- set_fact:\n ^ here\n"}
I solved it by preceding the bootstrap task with the following.
- set_fact:
splunk_mgmt_uri: "{{ ansible_fqdn }}"
- set_fact:
splunk_shc_uri_list: "{% for h in groups[splunk_shc_target_group] %}https://{{ hostvars[h].splunk_mgmt_uri }}:{{ splunkd_port }}{% if not loop.last %},{% endif %}{% endfor %}"# If you manage multiple SHCs, configure the var value in group_vars
Looking to start the conversation to see if anyone else can replicate the issue and/or if I should just move forward with a PR.
The text was updated successfully, but these errors were encountered:
ansible-role-for-splunk/roles/splunk/tasks/configure_shc_captain.yml
Line 3 in ad40708
I know I used this in the past on our last SHC, but this time it failed with the following error (after taking off
no_log
). This is possibly an ansible bug because I know we've upgraded the version of ansible on our control node since the last time we built a SHC.I solved it by preceding the bootstrap task with the following.
Looking to start the conversation to see if anyone else can replicate the issue and/or if I should just move forward with a PR.
The text was updated successfully, but these errors were encountered: