community.general.sensu_handler – Manages Sensu handler configuration¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.sensu_handler
.
Synopsis¶
Manages Sensu handler configuration
For more information, refer to the Sensu documentation: https://sensuapp.org/docs/latest/reference/handlers.html
Parameters¶
Examples¶
# Configure a handler that sends event data as STDIN (pipe)
- name: Configure IRC Sensu handler
community.general.sensu_handler:
name: "irc_handler"
type: "pipe"
command: "/usr/local/bin/notify-irc.sh"
severities:
- "ok"
- "critical"
- "warning"
- "unknown"
timeout: 15
notify:
- Restart sensu-client
- Restart sensu-server
# Delete a handler
- name: Delete IRC Sensu handler
community.general.sensu_handler:
name: "irc_handler"
state: "absent"
# Example of a TCP handler
- name: Configure TCP Sensu handler
community.general.sensu_handler:
name: "tcp_handler"
type: "tcp"
timeout: 30
socket:
host: "10.0.1.99"
port: 4444
register: handler
notify:
- Restart sensu-client
- Restart sensu-server
- name: Secure Sensu handler configuration file
ansible.builtin.file:
path: "{{ handler['file'] }}"
owner: "sensu"
group: "sensu"
mode: "0600"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
David Moreau Simard (@dmsimard)