cisco.dnac.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.dnac collection (version 6.49.0).

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

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

New in cisco.dnac 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.

  • dnacentersdk >= 2.7.2

  • python >= 3.9

Parameters

Parameter

Comments

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.

Destination and notification filters provide name-based filtering within selected components.

components_list

list / elements=string

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

Optional, but conditionally required when no other filter blocks are provided under component_specific_filters.

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

Valid component types - webhook_destinations - REST webhook destination configurations - email_destinations - Email destination with SMTP settings - syslog_destinations - Syslog server configurations - snmp_destinations - SNMP trap receiver configurations - itsm_settings - ITSM integration connection settings - webhook_event_notifications - Webhook event subscription configurations - email_event_notifications - Email event subscription configurations - syslog_event_notifications - Syslog event subscription configurations

Choices:

destination_filters

dictionary

Filters for destination configurations based on name or type matching.

Applies to webhook_destinations, email_destinations, syslog_destinations, and snmp_destinations components.

When destination_filters is provided, the corresponding destination components are automatically added to components_list if not already present. If destination_types is specified, only those types are added. If destination_types is omitted, all four destination component types are added.

Filtering is applied independently per component type selected in components_list.

Each component type only retrieves destinations of its own type and applies destination_names filter within that scope.

When destination_names provided and at least one name matches a destination within a component type, only matching destinations of that type are included.

destination_names

list / elements=string

List of exact destination names to filter from retrieved configurations.

Names must match exactly as configured in Catalyst Center (case-sensitive).

Only components listed in components_list are retrieved. The destination_names filter is applied only within those selected component types. Names belonging to a component type that is not in components_list are completely ignored.

If a destination name matches a destination within a selected component type, only matching destinations of that type are included in the output.

Empty list or not specified retrieves all destinations for selected component types.

destination_types

list / elements=string

Specifies which destination component types the destination_names filter applies to.

Components implied by destination_types are automatically added to components_list if not already present. For example webhook auto-adds webhook_destinations.

Use this when you want name-based filtering for some destination types but want to retrieve all destinations for other types in components_list.

For example, with components_list set to [webhook_destinations, email_destinations] and destination_types set to [webhook] and destination_names set to [my-webhook-1], only webhook destinations matching "my-webhook-1" are filtered while all email destinations are retrieved without any name filtering.

Valid types are webhook, email, syslog, snmp.

Choices:

itsm_filters

dictionary

Filters for ITSM integration settings based on instance name matching.

When itsm_filters is provided, the itsm_settings component is automatically added to components_list if not already present.

Filters ITSM integration instances by configured instance names.

Empty list or not specified retrieves all configured ITSM integration instances.

instance_names

list / elements=string

List of exact ITSM instance names to filter from retrieved configurations.

Names must match exactly as configured in Catalyst Center ITSM integration settings.

Filters ServiceNow, BMC Remedy, or custom ITSM integration instances.

Empty list or not specified retrieves all ITSM integration instances.

notification_filters

dictionary

Filters for event notification subscription configurations based on name or type.

Applies to webhook_event_notifications, email_event_notifications, and syslog_event_notifications.

When notification_filters is provided, the corresponding notification components are automatically added to components_list if not already present. If notification_types is specified, only those types are added. If notification_types is omitted, all three notification component types are added.

When subscription_names provided, filters notifications to include only matching subscriptions.

notification_types

list / elements=string

Specifies which notification component types the subscription_names filter applies to.

Components implied by notification_types are automatically added to components_list if not already present. For example webhook auto-adds webhook_event_notifications.

Use this when you want name-based filtering for some notification types but want to retrieve all subscriptions for other types in components_list.

For example, with components_list set to [webhook_event_notifications, email_event_notifications] and notification_types set to [webhook] and subscription_names set to [Critical Alerts], only webhook event notifications matching "Critical Alerts" are filtered while all email event notifications are retrieved without name filtering.

Valid types are webhook, email, syslog.

Choices:

subscription_names

list / elements=string

List of exact event subscription names to filter from retrieved configurations.

Names must match exactly as configured in Catalyst Center event subscriptions.

Filters webhook, email, and syslog event notifications based on subscription name.

Empty list or not specified retrieves all event subscriptions for selected types.

dnac_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`

dnac_debug

boolean

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

Choices:

dnac_host

string / required

The hostname of the Cisco Catalyst Center.

dnac_log

boolean

Flag to enable/disable playbook execution logging.

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

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

When false, - Logging is disabled.

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

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

Choices:

dnac_log_append

boolean

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

Choices:

dnac_log_file_path

string

Governs logging. Logs are recorded if dnac_log is True.

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

If path is specified, - When 'dnac_log_append' is True, the file opens in append mode. - When 'dnac_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:`"dnac.log"`

dnac_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"`

dnac_password

string

The password for authentication at the Cisco Catalyst Center.

dnac_port

string

Specifies the port number associated with the Cisco Catalyst Center.

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

dnac_task_poll_interval

integer

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

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

dnac_username

aliases: user

string

The username for authentication at the Cisco Catalyst Center.

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

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

dnac_version

string

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

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

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/system/api/v1/event/webhook - GET /dna/system/api/v1/event/email-config - GET /dna/system/api/v1/event/syslog-config - GET /dna/system/api/v1/event/snmp-config - GET /dna/system/api/v1/event/itsm-integration-setting - GET /dna/system/api/v1/event/subscription/rest - GET /dna/system/api/v1/event/subscription/email - GET /dna/system/api/v1/event/subscription/syslog - GET /dna/intent/api/v1/event-artifact - GET /dna/intent/api/v1/site

  • 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, SNMP, and event subscriptions.

  • Generated playbooks are compatible with events_and_notifications_workflow_manager module.

  • When filter blocks (destination_filters, notification_filters, itsm_filters) are provided, the corresponding components are automatically added to components_list if not already present. This means components_list is optional when filter blocks are provided.

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

  • Destination name filtering in destination_filters.destination_names is applied only within component types present in the final components_list (including auto-added components).

  • 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

  • The parameters starting with dnac_ are used by the Cisco Catalyst Center Python SDK to establish the connection

See Also

See also

cisco.dnac.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.dnac.events_and_notifications_playbook_config_generator:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    dnac_log: true
    dnac_log_level: "{{dnac_log_level}}"
    state: gathered
    file_path: "/tmp/catc_events_notifications_config.yaml"

- name: Generate YAML Configuration for destinations only
  cisco.dnac.events_and_notifications_playbook_config_generator:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    dnac_log: true
    dnac_log_level: "{{dnac_log_level}}"
    state: gathered
    file_path: "/tmp/catc_destinations_config.yaml"
    config:
      component_specific_filters:
        components_list: ["webhook_destinations", "email_destinations", "syslog_destinations"]

- name: Generate YAML Configuration for specific webhook destinations
  cisco.dnac.events_and_notifications_playbook_config_generator:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    dnac_log: true
    dnac_log_level: "{{dnac_log_level}}"
    state: gathered
    file_path: "/tmp/catc_webhook_config.yaml"
    config:
      component_specific_filters:
        components_list: ["webhook_destinations", "webhook_event_notifications"]
        destination_filters:
          destination_names: ["webhook-dest-1", "webhook-dest-2"]
          destination_types: ["webhook"]

- name: Generate YAML Configuration with combined filters
  cisco.dnac.events_and_notifications_playbook_config_generator:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    dnac_log: true
    dnac_log_level: "{{dnac_log_level}}"
    state: gathered
    file_path: "/tmp/combined_filters_config.yaml"
    file_mode: append
    config:
      component_specific_filters:
        components_list: ["webhook_destinations", "webhook_event_notifications", "email_destinations", "email_event_notifications"]
        destination_filters:
          destination_names: ["Production Webhook", "Alert Email Server"]
          destination_types: ["webhook", "email"]
        notification_filters:
          subscription_names: ["Critical System Alerts", "Network Health Monitoring"]
          notification_types: ["webhook", "email"]

- name: Generate YAML Configuration for ITSM settings using filter block (auto-adds itsm_settings to components_list)
  cisco.dnac.events_and_notifications_playbook_config_generator:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    dnac_log: true
    dnac_log_level: "{{dnac_log_level}}"
    state: gathered
    file_path: "/tmp/catc_itsm_config.yaml"
    config:
      component_specific_filters:
        itsm_filters:
          instance_names: ["ServiceNow Instance 1", "BMC Remedy 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)