cisco.catalystcenter.events_and_notifications_playbook_config_generator module -- Generate YAML playbook for 'events_and_notifications_workflow_manager' module.

Note

This module is part of the cisco.catalystcenter collection (version 2.9.0).

To install it, use: ansible-galaxy collection install cisco.catalystcenter. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.catalystcenter.events_and_notifications_playbook_config_generator.

New in cisco.catalystcenter 6.44.0

Synopsis

  • Generates YAML configurations compatible with the events_and_notifications_workflow_manager module for brownfield infrastructure discovery and documentation.

  • Retrieves existing events and notifications configurations from Cisco Catalyst Center including webhook destinations, email destinations, syslog destinations, SNMP destinations, ITSM integration settings, and event subscriptions.

  • Transforms API responses to playbook-compatible YAML format with parameter name mapping, password redaction, and structure optimization for Ansible execution.

  • Supports comprehensive filtering capabilities including component-specific filters, destination name filters, and notification subscription filters.

  • Resolves site IDs to hierarchical site names and event IDs to event names for human-readable playbook generation.

  • Creates structured playbook files ready for modification and redeployment through events_and_notifications_workflow_manager module.

Requirements

The below requirements are needed on the host that executes this module.

  • catalystcentersdk >= 3.1.6.0.2

  • python >= 3.9

Parameters

Parameter

Comments

catalystcenter_api_task_timeout

integer

Defines the timeout in seconds for API calls to retrieve task details. If the task details are not received within this period, the process will end, and a timeout notification will be logged.

Default: :ansible-option-default:`1200`

catalystcenter_debug

boolean

Indicates whether debugging is enabled in the Cisco Catalyst Center SDK.

Choices:

catalystcenter_host

string / required

The hostname of the Cisco Catalyst Center.

catalystcenter_log

boolean

Flag to enable/disable playbook execution logging.

When true and catalystcenter_log_file_path is provided, - Create the log file at the execution location with the specified name.

When true and catalystcenter_log_file_path is not provided, - Create the log file at the execution location with the name 'catalystcenter.log'.

When false, - Logging is disabled.

If the log file doesn't exist, - It is created in append or write mode based on the "catalystcenter_log_append" flag.

If the log file exists, - It is overwritten or appended based on the "catalystcenter_log_append" flag.

Choices:

catalystcenter_log_append

boolean

Determines the mode of the file. Set to True for 'append' mode. Set to False for 'write' mode.

Choices:

catalystcenter_log_file_path

string

Governs logging. Logs are recorded if catalystcenter_log is True.

If path is not specified, - When 'catalystcenter_log_append' is True, 'catalystcenter.log' is generated in the current Ansible directory; logs are appended. - When 'catalystcenter_log_append' is False, 'catalystcenter.log' is generated; logs are overwritten.

If path is specified, - When 'catalystcenter_log_append' is True, the file opens in append mode. - When 'catalystcenter_log_append' is False, the file opens in write (w) mode. - In shared file scenarios, without append mode, content is overwritten after each module execution. - For a shared log file, set append to False for the 1st module (to overwrite); for subsequent modules, set append to True.

Default: :ansible-option-default:`"catalystcenter.log"`

catalystcenter_log_level

string

Sets the threshold for log level. Messages with a level equal to or higher than this will be logged. Levels are listed in order of severity [CRITICAL, ERROR, WARNING, INFO, DEBUG].

CRITICAL indicates serious errors halting the program. Displays only CRITICAL messages.

ERROR indicates problems preventing a function. Displays ERROR and CRITICAL messages.

WARNING indicates potential future issues. Displays WARNING, ERROR, CRITICAL messages.

INFO tracks normal operation. Displays INFO, WARNING, ERROR, CRITICAL messages.

DEBUG provides detailed diagnostic info. Displays all log messages.

Default: :ansible-option-default:`"WARNING"`

catalystcenter_password

string

The password for authentication at the Cisco Catalyst Center.

catalystcenter_port

string

Specifies the port number associated with the Cisco Catalyst Center.

Default: :ansible-option-default:`"443"`

catalystcenter_task_poll_interval

integer

Specifies the interval in seconds between successive calls to the API to retrieve task details.

Default: :ansible-option-default:`2`

catalystcenter_username

string

The username for authentication at the Cisco Catalyst Center.

Default: :ansible-option-default:`"admin"`

catalystcenter_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

catalystcenter_version

string

Specifies the version of the Cisco Catalyst Center that the SDK should use.

Default: :ansible-option-default:`"2.3.7.6"`

config

dictionary

A dictionary of filters for generating YAML playbook compatible with the events_and_notifications_workflow_manager module.

If config is omitted, the module retrieves all supported components and generates configurations for every available component type.

If config is provided, component_specific_filters is mandatory.

component_specific_filters

dictionary

Filter configuration controlling which components are included in generated YAML playbook.

Mandatory when config is provided.

When components_list is specified, only listed components are retrieved regardless of other filters.

Component-specific filter keys use the same names as the component values in components_list.

If filters for specific components are provided without explicitly including them in components_list, those components are automatically added.

components_list

list / elements=string

List of component types to include in generated YAML playbook file.

Optional, but conditionally required when no other component- specific filter keys are provided under component_specific_filters.

Each component type corresponds to specific API endpoint and configuration structure.

Valid component types - webhook_destination - REST webhook destination configurations - email_destination - Email destination with SMTP settings - syslog_destination - Syslog server configurations - snmp_destination - SNMP trap receiver configurations - itsm_setting - ITSM integration connection settings - webhook_event_notification - Webhook event subscription configurations - email_event_notification - Email event subscription configurations - syslog_event_notification - Syslog event subscription configurations

Choices:

email_destination

list / elements=dictionary

List of filter dictionaries for email destinations.

Supported filter keys are sender_email and recipient_email.

If omitted while the component is selected, all email destinations are retrieved.

email_event_notification

list / elements=dictionary

List of filter dictionaries for email event subscriptions.

Supported filter key is name.

If omitted while the component is selected, all email event notifications are retrieved.

itsm_setting

list / elements=dictionary

List of filter dictionaries for ITSM settings.

Supported filter key is instance_name.

If omitted while the component is selected, all ITSM integration instances are retrieved.

snmp_destination

list / elements=dictionary

List of filter dictionaries for SNMP destinations.

Supported filter key is name.

If omitted while the component is selected, all SNMP destinations are retrieved.

syslog_destination

list / elements=dictionary

List of filter dictionaries for syslog destinations.

Supported filter key is name.

If omitted while the component is selected, all syslog destinations are retrieved.

syslog_event_notification

list / elements=dictionary

List of filter dictionaries for syslog event subscriptions.

Supported filter key is name.

If omitted while the component is selected, all syslog event notifications are retrieved.

webhook_destination

list / elements=dictionary

List of filter dictionaries for webhook destinations.

Supported filter key is name.

If omitted while the component is selected, all webhook destinations are retrieved.

webhook_event_notification

list / elements=dictionary

List of filter dictionaries for webhook event subscriptions.

Supported filter key is name.

If omitted while the component is selected, all webhook event notifications are retrieved.

file_mode

string

File write mode for the generated YAML configuration file.

The overwrite option replaces existing file content with new content.

The append option adds new content to the end of existing file.

Relevant only when file_path is provided.

Defaults to overwrite if not specified.

Choices:

file_path

string

Absolute or relative path where generated YAML configuration file will be saved.

If not provided, file is saved in current working directory with auto-generated filename.

Filename format when auto-generated is events_and_notifications_playbook_config_<YYYY-MM-DD_HH-MM-SS>.yml.

Example auto-generated filename "events_and_notifications_playbook_config_2025-04-22_21-43-26.yml".

Parent directories are created automatically if they do not exist.

state

string

Desired state for module execution controlling playbook generation workflow.

Only 'gathered' state is supported for retrieving configurations from Catalyst Center.

The 'gathered' state initiates configuration discovery, API calls, transformation, and YAML file generation.

Choices:

validate_response_schema

boolean

Flag for Cisco Catalyst Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

Notes

Note

  • SDK Methods used are - event_management.Events.get_webhook_destination - event_management.Events.get_email_destination - event_management.Events.get_syslog_destination - event_management.Events.get_snmp_destination - event_management.Events.get_all_itsm_integration_settings - event_management.Events.get_rest_webhook_event_subscriptions - event_management.Events.get_email_event_subscriptions - event_management.Events.get_syslog_event_subscriptions - event_management.Events.get_event_artifacts - sites.Sites.get_site

  • Paths used are - GET /dna/intent/api/v1/event/webhook - GET /dna/intent/api/v1/event/email-config - GET /dna/intent/api/v1/event/syslog-config - GET /dna/intent/api/v1/dna-event/snmp-config - GET /dna/intent/api/v1/integration-settings/itsm/instances - GET /dna/intent/api/v1/event/subscription/rest - GET /dna/intent/api/v1/event/subscription/email - GET /dna/intent/api/v1/event/subscription/syslog - GET /dna/system/api/v1/event/artifact - GET /dna/intent/api/v1/sites

  • Minimum Catalyst Center version required is 2.3.5.3 for events and notifications APIs.

  • Module performs read-only operations and does not modify Catalyst Center configurations.

  • Generated YAML files contain password placeholders marked as "***REDACTED***" for security.

  • Site IDs are automatically resolved to hierarchical site names for readability.

  • Event IDs are automatically resolved to event names using Event Artifacts API.

  • Pagination is automatically handled for large datasets in webhook, syslog, SNMP destinations, ITSM settings and webhook, email, syslog notifications.

  • Generated playbooks are compatible with events_and_notifications_workflow_manager module.

  • Component-specific filter keys such as webhook_destination, itsm_setting, and email_event_notification are automatically added to components_list if not already present.

  • If no component-specific filter keys are provided, components_list is mandatory and must be non-empty.

  • Does not support check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins instead embedded connection manager from Cisco Catalyst Center SDK

See Also

See also

cisco.catalystcenter.events_and_notifications_workflow_manager

Module to manage Events and Notifications configurations in Cisco Catalyst Center.

Examples

- name: Generate YAML Configuration with all events and notifications components
  cisco.catalystcenter.events_and_notifications_playbook_config_generator:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    catalystcenter_log: true
    catalystcenter_log_level: "{{catalystcenter_log_level}}"
    state: gathered
    file_path: "/tmp/catc_events_notifications_config.yaml"

- name: Generate YAML Configuration for destinations only
  cisco.catalystcenter.events_and_notifications_playbook_config_generator:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    catalystcenter_log: true
    catalystcenter_log_level: "{{catalystcenter_log_level}}"
    state: gathered
    file_path: "/tmp/catc_destinations_config.yaml"
    config:
      component_specific_filters:
        components_list: ["webhook_destination", "email_destination", "syslog_destination"]

- name: Generate YAML Configuration for specific webhook destinations
  cisco.catalystcenter.events_and_notifications_playbook_config_generator:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    catalystcenter_log: true
    catalystcenter_log_level: "{{catalystcenter_log_level}}"
    state: gathered
    file_path: "/tmp/catc_webhook_config.yaml"
    config:
      component_specific_filters:
        components_list: ["webhook_destination", "webhook_event_notification"]
        webhook_destination:
          - name: ["webhook-dest-1", "webhook-dest-2"]

- name: Generate YAML Configuration with combined filters
  cisco.catalystcenter.events_and_notifications_playbook_config_generator:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    catalystcenter_log: true
    catalystcenter_log_level: "{{catalystcenter_log_level}}"
    state: gathered
    file_path: "/tmp/combined_filters_config.yaml"
    file_mode: append
    config:
      component_specific_filters:
        components_list: ["webhook_destination", "webhook_event_notification", "email_destination", "email_event_notification"]
        webhook_destination:
          - name: ["Production Webhook"]
        email_destination:
          - sender_email: ["alerts@cisco.com"]
          - recipient_email: ["noc@cisco.com"]
        webhook_event_notification:
          - name: ["Critical System Alerts"]
        email_event_notification:
          - name: ["Network Health Monitoring"]

- name: Generate YAML Configuration for ITSM settings using component filter (auto-adds itsm_setting to components_list)
  cisco.catalystcenter.events_and_notifications_playbook_config_generator:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    catalystcenter_log: true
    catalystcenter_log_level: "{{catalystcenter_log_level}}"
    state: gathered
    file_path: "/tmp/catc_itsm_config.yaml"
    config:
      component_specific_filters:
        itsm_setting:
          - instance_name: ["ServiceNow Instance 1", "BMC Remedy Prod"]

- name: Generate config with component-specific name filters
  cisco.catalystcenter.events_and_notifications_playbook_config_generator:
    catalystcenter_host: "{{ catalystcenter_host }}"
    catalystcenter_username: "{{ catalystcenter_username }}"
    catalystcenter_password: "{{ catalystcenter_password }}"
    catalystcenter_verify: "{{ catalystcenter_verify }}"
    config:
      component_specific_filters:
      components_list:
        - "syslog_destination"
        - "email_event_notification"
        - "itsm_setting"
      syslog_destination:
        - name: ["Scale Syslog 7"]
      email_event_notification:
        - name: ["Critical Email Alerts"]
      itsm_setting:
        - instance_name: ["ServiceNow Prod"]

Return Values

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

Key

Description

response_1

dictionary

response_2

list / elements=string

Authors

  • Priyadharshini B (@pbalaku2)

  • Madhan Sankaranarayanan (@madhansansel)