splunk / splunk-ansible

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

Scripts fail on "Wait for splunkd management port" #770

Closed tod-uma closed 6 months ago

tod-uma commented 8 months ago

when using this to install a universal forwarder 9.1.2, the scripts fail on "Wait for splunkd management port". This is because now by default the forwarder doesn't actually listen on a tcp managment port on linux, it uses a socket file instead. By default the mgmtMode is set to auto, which means it does not listen on a tcp port. The scripts need to be updated to find a different way to know when the splunkd is up.

See mgmtMode in: https://docs.splunk.com/Documentation/Splunk/9.1.2/Admin/Serverconf

Error when running:

TASK [splunk_common : Wait for splunkd management port] *** fatal: [test-forwarder.test.test]: FAILED! => changed=false elapsed: 300 msg: Timeout when waiting for 127.0.0.1:8089

adityapinglesf commented 8 months ago

can you share more about the environment you face this error?

tod-uma commented 8 months ago

Yes, I'm using the Ansible scripts to install the universal forwarder on a new OEL9 VM. It uses the Splunk provided RPM to install.

adityapinglesf commented 6 months ago

we released new updates for 9.1.x to support unix domain socket files. that should resolve this issue. feel free to comment if you still run into errors

tod-uma commented 6 months ago

we released new updates for 9.1.x to support unix domain socket files. that should resolve this issue. feel free to comment if you still run into errors

unix sockets code seems to work, but I'm having other issues with that update. Specifically the calls to splunk_api. They seem to be in the library/ directory, but when you bring splunk-ansible in as a role or collection to a different ansible project, it does not look in that library/ directory for modules. I'm looking at how hard it would be to structure as a proper ansible collection so that the module imports correctly.

tod-uma commented 6 months ago

I have gotten it to work in my environment with the development branch. Thank you for the fix.