sensu.sensu_go.silence (0.9.0) — module

Manages Sensu silences

Authors: Paul Arthur (@flowerysong), Aljaz Kosir (@aljazkosir), Manca Bizjak (@mancabizjak), Tadej Borovsak (@tadeboro)

preview | supported by XLAB Steampunk

Install collection

Install with ansible-galaxy collection install sensu.sensu_go:==0.9.0


Add to requirements.yml

  collections:
    - name: sensu.sensu_go
      version: 0.9.0

Description

For more information, refer to the Sensu documentation at U(https://docs.sensu.io/sensu-go/latest/reference/silencing/)

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Silence a specific check
  silence:
    subscription: proxy
    check: check-disk
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Silence specific check regardless of the originating entities subscription
  silence:
    check: check-cpu
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Silence all checks on a specific entity
  silence:
    subscription: entity:important-entity
    expire: 120
    reason: rebooting the world

Inputs

    
auth:
    description:
    - Authentication parameters. Can define each of them with ENV as well.
    suboptions:
      namespace:
        default: default
        description:
        - RBAC namespace to operate in. If this is not set the value of the SENSU_NAMESPACE
          environment variable will be checked.
        type: str
      password:
        default: P@ssw0rd!
        description:
        - The Sensu user's password. If this is not set the value of the SENSU_PASSWORD
          environment variable will be checked.
        type: str
      url:
        default: http://localhost:8080
        description:
        - Location of the Sensu backend API. If this is not set the value of the SENSU_URL
          environment variable will be checked.
        type: str
      user:
        default: admin
        description:
        - The username to use for connecting to the Sensu API. If this is not set the
          value of the SENSU_USER environment variable will be checked.
        type: str
    type: dict

begin:
    description:
    - UNIX time at which silence entry goes into effect.
    type: int

check:
    description:
    - The name of the check the entry should match. If left empty a silencing entry will
      contain an asterisk in the check position. This indicates that any event where the
      originating entities subscriptions match the subscription specified in the entry
      will be marked as silenced, regardless of the check name.
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Target state of the Sensu object.
    type: str

expire:
    description:
    - Number of seconds until the silence expires.
    type: int

labels:
    description:
    - Custom metadata fields that can be accessed within Sensu, as key/value pairs.
    type: dict

reason:
    description:
    - Reason for silencing.
    type: str

annotations:
    description:
    - Custom metadata fields with fewer restrictions, as key/value pairs.
    - These are preserved by Sensu but not accessible as tokens or identifiers, and are
      mainly intended for use with external tools.
    type: dict

subscription:
    description:
    - The name of the subscription the entry should match. If left empty a silencing entry
      will contain an asterisk in the subscription position. This indicates that any event
      with a matching check name will be marked as silenced, regardless of the originating
      entities subscriptions. Specific entity can also be targeted by taking advantage
      of per-entity subscription (entity:<entity_name>)
    type: str

expire_on_resolve:
    description:
    - If the entry should be deleted when a check begins return OK status (resolves).
    type: bool

Outputs

object:
  description: object representing Sensu silence
  returned: success
  type: dict