Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use splunk_api for Remove existing HEC token #818

Merged
merged 2 commits into from Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions roles/splunk_common/tasks/set_as_hec_receiver.yml
Expand Up @@ -36,12 +36,14 @@

# The REST API does not support modifying tokens in-place, so we'll need to delete/re-create
- name: Remove existing HEC token
uri:
url: "{{ cert_prefix }}://127.0.0.1:{{ splunk.svc_port }}/services/data/inputs/http/splunk_hec_token"
splunk_api:
url: "/services/data/inputs/http/splunk_hec_token"
method: DELETE
user: "{{ splunk.admin_user }}"
cert_prefix: "{{ cert_prefix }}"
username: "{{ splunk.admin_user }}"
password: "{{ splunk.password }}"
status_code: 200,404
status_code: [200, 404]
svc_port: "{{ splunk.svc_port }}"
timeout: 60
use_proxy: no
register: delete_hec_token
Expand Down