community.general.sensu_subscription module – Manage Sensu subscriptions

Note

This module is part of the community.general collection (version 10.2.0).

You might already have this collection installed if you are using the ansible package. 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 community.general.

To use it in a playbook, specify: community.general.sensu_subscription.

DEPRECATED

Removed in:

version 13.0.0

Why:

Sensu Core and Sensu Enterprise products have been End of Life since 2019/20.

Alternative:

Use Sensu Go and its accompanying collection sensu.sensu_go.

Synopsis

  • Manage which sensu channels a machine should subscribe to.

Parameters

Parameter

Comments

backup

boolean

Create a backup file (if yes), including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.

Choices:

  • false ← (default)

  • true

name

string / required

The name of the channel.

path

string

Path to the subscriptions JSON file.

Default: "/etc/sensu/conf.d/subscriptions.json"

state

string

Whether the machine should subscribe or unsubscribe from the channel.

Choices:

  • "present" ← (default)

  • "absent"

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

# Subscribe to the nginx channel
- name: Subscribe to nginx checks
  community.general.sensu_subscription: name=nginx

# Unsubscribe from the common checks channel
- name: Unsubscribe from common checks
  community.general.sensu_subscription: name=common state=absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

reasons

list / elements=string

The reasons why the module changed or did not change something.

Returned: success

Sample: ["channel subscription was absent and state is `present'"]

Status

  • This module will be removed in version 13.0.0. [deprecated]

  • For more information see DEPRECATED.

Authors

  • Anders Ingemann (@andsens)