netapp.storagegrid.na_sg_grid_alert_receiver module – NetApp StorageGRID manage alert receiver.

Note

This module is part of the netapp.storagegrid collection (version 21.15.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 netapp.storagegrid.

To use it in a playbook, specify: netapp.storagegrid.na_sg_grid_alert_receiver.

New in netapp.storagegrid 21.15.0

Synopsis

  • Create, update, or delete alert receivers on NetApp StorageGRID.

Parameters

Parameter

Comments

api_url

string / required

The url to the StorageGRID Admin Node REST API.

auth_token

string / required

The authorization token for the API request

ca_cert

string

CA certificate used to verify the identity of the SMTP server.

client_cert

string

Client certificate for the SMTP server.

client_key

string

The PEM-encoded private key for the client certificate.

enable

boolean

Whether alert notifications are sent to this receiver.

Choices:

  • false

  • true ← (default)

from_email

string

Sender email address.

minimum_severity

string

Minimum severity level for triggering an alert.

Choices:

  • "minor"

  • "major"

  • "critical"

password

string

Password for the SMTP server.

smtp_host

string

The IP address or hostname of the SMTP server.

smtp_port

integer

The port to use to communicate with the SMTP server.

state

string

Whether the alert receiver should be present or absent.

Choices:

  • "present" ← (default)

  • "absent"

to_emails

list / elements=string

List of recipient email addresses.

type

string / required

The type of notification receiver.

Choices:

  • "email"

username

string

Username for the SMTP server.

validate_certs

boolean

Should https certificates be validated?

Choices:

  • false

  • true ← (default)

Notes

Note

  • The modules prefixed with na_sg are built to manage NetApp StorageGRID.

Examples

- name: Create alert receiver
  netapp.storagegrid.na_sg_alert_receiver:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    state: present
    type: email
    enable: true
    smtp_host: "smtp.example.com"
    smtp_port: 25
    username: "smtp-user"
    password: "smtp-password"
    from_email: "[email protected]"
    to_emails:
      - "[email protected]"
    minimum_severity: "minor"
    ca_cert: "-----BEGIN CERTIFICATE-----*******-----END CERTIFICATE-----"
    client_cert: "-----BEGIN CERTIFICATE-----*******-----END CERTIFICATE-----"
    client_key: "-----BEGIN PRIVATE KEY-----*******-----END PRIVATE KEY-----"

- name: Delete alert receiver
  netapp.storagegrid.na_sg_alert_receiver:
    api_url: "https://<storagegrid-endpoint-url>"
    auth_token: "storagegrid-auth-token"
    validate_certs: false
    state: present
    type: email

Return Values

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

Key

Description

resp

dictionary

Returns the response from the StorageGRID API for alert receiver.

Returned: success

Sample: {"caCert": "-----BEGIN CERTIFICATE-----*******-----END CERTIFICATE-----", "clientCert": "-----BEGIN CERTIFICATE-----*******-----END CERTIFICATE-----", "clientKey": "-----BEGIN PRIVATE KEY-----*******-----END PRIVATE KEY-----", "enable": true, "fromEmail": "user@example.com", "minimumSeverity": "minor", "password": "smtp-password", "smtpHost": "smtp.example.com", "smtpPort": 25, "toEmails": ["user@example.com"], "type": "email", "username": "smtp-user"}

Authors

  • NetApp Ansible Team (@vinaykus)