cdillc.splunk.splunk_control module – Control the Splunkd service
Note
This module is part of the cdillc.splunk collection (version 0.26.1).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cdillc.splunk
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cdillc.splunk.splunk_control
.
New in cdillc.splunk 0.10.0
Synopsis
Restart the Splunkd service using Ansible.
This module uses the Python Splunk SDK and requires access to the splunkd administrative port.
Authentication can be handled via either username and password or via token.
Requirements
The below requirements are needed on the host that executes this module.
splunk-sdk
Parameters
Parameter |
Comments |
---|---|
The password for username/password authentication. Must be provided if username is provided. |
|
The Splunkd endpoint of the Splunk server to configure. Defaults to the local server and default splunkd port. Default: |
|
Ensure the service is restarted or offlined. Choices:
|
|
Amount of time (in seconds) to wait for the server to come back online. Set to 0 to disable the timeout and return immediately. Default: |
|
Token to use when authentication has already taken place. The This module returns an output named token that can be used for subsequent splunkd calls to the same splunkd endpoint. |
|
Splunk username for username/password authentication. When provided, password must also be specified. |
|
Only restart if the ‘restart required’ flag has been set. By default, this module will force a restart. Choices:
|
Examples
- name: Restart the local Splunkd service and wait for it to come back online:
cdillc.splunk.splunk_control:
state: restarted
username: admin
password: manage