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 |
|---|---|
A dictionary of filters for generating YAML playbook compatible with the If If |
|
Filter configuration controlling which components are included in generated YAML playbook. Mandatory when 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. |
|
List of component types to include in generated YAML playbook file. Optional, but conditionally required when no other filter blocks are provided under Each component type corresponds to specific API endpoint and configuration structure. Valid component types - Choices: |
|
Filters for destination configurations based on name or type matching. Applies to webhook_destinations, email_destinations, syslog_destinations, and snmp_destinations components. When 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. |
|
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. |
|
Specifies which destination component types the Components implied by Use this when you want name-based filtering for some destination types but want to retrieve all destinations for other types in For example, with Valid types are Choices: |
|
Filters for ITSM integration settings based on instance name matching. When Filters ITSM integration instances by configured instance names. Empty list or not specified retrieves all configured ITSM integration instances. |
|
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. |
|
Filters for event notification subscription configurations based on name or type. Applies to webhook_event_notifications, email_event_notifications, and syslog_event_notifications. When When subscription_names provided, filters notifications to include only matching subscriptions. |
|
Specifies which notification component types the Components implied by Use this when you want name-based filtering for some notification types but want to retrieve all subscriptions for other types in For example, with Valid types are Choices: |
|
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. |
|
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` |
|
Indicates whether debugging is enabled in the Cisco Catalyst Center SDK. Choices: |
|
The hostname of the Cisco Catalyst Center. |
|
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: |
|
Determines the mode of the file. Set to True for 'append' mode. Set to False for 'write' mode. Choices: |
|
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"` |
|
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"` |
|
The password for authentication at the Cisco Catalyst Center. |
|
Specifies the port number associated with the Cisco Catalyst Center. Default: :ansible-option-default:`"443"` |
|
Specifies the interval in seconds between successive calls to the API to retrieve task details. Default: :ansible-option-default:`2` |
|
The username for authentication at the Cisco Catalyst Center. Default: :ansible-option-default:`"admin"` |
|
Flag to enable or disable SSL certificate verification. Choices: |
|
Specifies the version of the Cisco Catalyst Center that the SDK should use. Default: :ansible-option-default:`"2.2.3.3"` |
|
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 Defaults to overwrite if not specified. Choices: |
|
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 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. |
|
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: |
|
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 tocomponents_listif not already present. This meanscomponents_listis optional when filter blocks are provided.If no filter blocks are provided,
components_listis 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_modeThe 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 |
|---|---|
A dictionary with the response returned by the Cisco Catalyst Center Returned: always |
|
A string with the response returned by the Cisco Catalyst Center Returned: always |