cisco.dnac.accesspoint_playbook_config_generator module -- Generate YAML configurations playbook for 'accesspoint_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.accesspoint_playbook_config_generator.
New in cisco.dnac 6.45.0
Synopsis
Generates YAML configurations compatible with the 'accesspoint_workflow_manager' module, reducing the effort required to manually create Ansible playbooks and enabling programmatic modifications.
Supports complete access point playbook config generation by collecting all access point configurations from Cisco Catalyst Center.
Enables targeted extraction using filters (site hierarchies, provisioned hostnames, AP configurations, or MAC addresses).
Auto-generates timestamped YAML filenames when file path not specified.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk >= 2.10.10
python >= 3.9
Parameters
Parameter |
Comments |
|---|---|
A dictionary of filters for generating YAML playbook compatible with the 'accesspoint_playbook_config_generator' module. Filters specify which components to include in the YAML configuration file. If If |
|
Global filters to apply when generating the YAML configuration file. These filters apply to all components unless overridden by component-specific filters. At least one filter type must be specified to identify target access points. Filter priority (highest to lowest) is site_list, provision_hostname_list, accesspoint_config_list, accesspoint_provision_config_list, accesspoint_provision_config_mac_list. Only the highest priority filter with valid data will be processed. |
|
List of access point hostnames to extract configurations from. MEDIUM PRIORITY - Only used if site_list and provision_hostname_list are not provided. Case-sensitive and must be exact matches. Can also be set to "all" to include all configured access points. Example ["Test_ap_1", "Test_ap_2"] Retrieves AP configuration details for specified hostnames. |
|
List of access point hostnames assigned to floors with both provisioning and configuration data. MEDIUM-LOW PRIORITY - Only used if higher priority filters are not provided. Case-sensitive and must be exact matches. Example ["Test_ap_1", "Test_ap_2"] Retrieves combined provisioning and configuration details. |
|
List of access point MAC addresses assigned to floors with provisioning and configuration data. LOWEST PRIORITY - Only used if no other filters are provided. Case-sensitive and must be exact matches. Example ["a4:88:73:d4:dd:80", "a4:88:73:d4:dd:81"] Retrieves AP details by MAC address filtering. |
|
List of access point hostnames with provisioned configurations to the floor. MEDIUM-HIGH PRIORITY - Only used if site_list is not provided. Case-sensitive and must be exact matches. Can also be set to "all" to include all provisioned access points. Example ["test_ap_1", "test_ap_2"] Retrieves provisioning details for specified AP hostnames. |
|
List of floor site hierarchies to extract AP configurations from. HIGHEST PRIORITY - Used first if provided with valid data. Site hierarchies must match those registered in Catalyst Center. Case-sensitive and must be exact matches. Can also be set to "all" to include all access point configurations. Example ["Global/USA/SAN JOSE/SJ_BLD20/FLOOR1", "Global/USA/SAN JOSE/SJ_BLD20/FLOOR2"] Module will extract APs provisioned to these specific floor sites. |
|
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"` |
|
Determines how the output YAML configuration file is written. Relevant only when When set to When set to Choices: |
|
Path where the YAML configuration file will be saved. If not provided, the file will be saved in the current working directory with a default file name For example, Supports both absolute and relative file paths. |
|
The desired state of Cisco Catalyst Center after module execution. Choices: |
|
Flag for Cisco Catalyst Center SDK to enable the validation of request bodies against a JSON schema. Choices: |
Notes
Note
This module utilizes the following SDK methods devices.get_device_list wireless.get_access_point_configuration sites.get_site sda.get_device_info sites.assign_devices_to_site wireless.ap_provision wireless.configure_access_points sites.get_membership
The following API paths are used GET /dna/intent/api/v1/network-device GET /dna/intent/api/v1/site GET /dna/intent/api/v1/business/sda/device GET /dna/intent/api/v1/membership/{siteId}
Minimum Cisco Catalyst Center version required is 2.3.5.3 for YAML playbook generation support.
Filter priority hierarchy ensures only one filter type is processed per execution.
Module creates YAML file compatible with 'accesspoint_workflow_manager' module for automation workflows.
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
Examples
---
- name: Auto-generate YAML Configuration for all Access Point provision and configuration
cisco.dnac.accesspoint_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_mode: "overwrite"
- name: Auto-generate YAML Configuration for all Access Point provision and configuration with custom file path
cisco.dnac.accesspoint_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/accesspoint_workflow_playbook.yml"
file_mode: "overwrite"
- name: Generate YAML Configuration with file path based on site list filters
cisco.dnac.accesspoint_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/accesspoint_workflow_playbook_site_base.yml"
file_mode: "append"
config:
global_filters:
site_list:
- Global/USA/SAN JOSE/SJ_BLD20/FLOOR1
- Global/USA/SAN JOSE/SJ_BLD20/FLOOR2
- name: Generate YAML provision config with file path based on hostname list filters
cisco.dnac.accesspoint_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/accesspoint_workflow_playbook_hostname_provision_base.yml"
file_mode: "overwrite"
config:
global_filters:
provision_hostname_list:
- test_ap_1
- test_ap_2
- name: Generate YAML Configuration with file path based on hostname list
cisco.dnac.accesspoint_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/accesspoint_workflow_playbook_hostname_base.yml"
file_mode: "overwrite"
config:
global_filters:
accesspoint_config_list:
- Test_ap_1
- Test_ap_2
- name: Generate YAML provision and configuration with default file path based on hostname list
cisco.dnac.accesspoint_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/accesspoint_workflow_playbook_hostname_provision_base.yml"
file_mode: "overwrite"
config:
global_filters:
accesspoint_provision_config_list:
- Test_ap_1
- Test_ap_2
- name: Generate YAML accesspoint provision Configuration based on MAC Address list
cisco.dnac.accesspoint_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/accesspoint_workflow_playbook_mac_base.yml"
file_mode: "overwrite"
config:
global_filters:
accesspoint_provision_config_mac_list:
- a4:88:73:d4:dd:80
- a4:88:73:d4:dd:81
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 Python SDK Returned: always |
|
A string with the response returned by the Cisco Catalyst Center Python SDK Returned: always |