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 |
|---|---|
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 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: |
|
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 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. |
|
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.3.7.6"` |
|
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. Component-specific filter keys use the same names as the component values in If filters for specific components are provided without explicitly including them in |
|
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 Each component type corresponds to specific API endpoint and configuration structure. Valid component types - Choices: |
|
List of filter dictionaries for email destinations. Supported filter keys are If omitted while the component is selected, all email destinations are retrieved. |
|
List of filter dictionaries for email event subscriptions. Supported filter key is If omitted while the component is selected, all email event notifications are retrieved. |
|
List of filter dictionaries for ITSM settings. Supported filter key is If omitted while the component is selected, all ITSM integration instances are retrieved. |
|
List of filter dictionaries for SNMP destinations. Supported filter key is If omitted while the component is selected, all SNMP destinations are retrieved. |
|
List of filter dictionaries for syslog destinations. Supported filter key is If omitted while the component is selected, all syslog destinations are retrieved. |
|
List of filter dictionaries for syslog event subscriptions. Supported filter key is If omitted while the component is selected, all syslog event notifications are retrieved. |
|
List of filter dictionaries for webhook destinations. Supported filter key is If omitted while the component is selected, all webhook destinations are retrieved. |
|
List of filter dictionaries for webhook event subscriptions. Supported filter key is If omitted while the component is selected, all webhook event notifications are retrieved. |
|
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/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, andemail_event_notificationare automatically added tocomponents_listif not already present.If no component-specific filter keys are provided,
components_listis mandatory and must be non-empty.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
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 |
|---|---|
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 |