cisco.dnac.network_settings_playbook_config_generator module -- Generate YAML playbook for 'network_settings_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.network_settings_playbook_config_generator.
New in cisco.dnac 6.44.0
Synopsis
Generates YAML configurations compatible with the `network_settings_workflow_manager` module, reducing the effort required to manually create Ansible playbooks and enabling programmatic modifications.
The YAML configurations generated represent the global pools, reserve pools, network management settings, device controllability settings, and AAA settings configured on the Cisco Catalyst Center.
Supports extraction of Global IP Pools, Reserve IP Pools, Network Management, Device Controllability, and AAA Settings configurations.
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 `network_settings_workflow_manager` module. If not provided, module runs internal auto-discovery for all supported components. If provided, only |
|
Filters to specify which network settings components and features to include in the YAML configuration file. Allows granular selection of specific components and their parameters. Mandatory when |
|
List of components to include in the YAML configuration file. Valid values are ["global_pool_details", "reserve_pool_details", "network_management_details", "device_controllability_details"] If omitted, components are inferred from provided component filter blocks. If a component filter block is provided but the component is missing in Example ["global_pool_details", "reserve_pool_details", "network_management_details"] Choices: |
|
Device controllability settings to filter by site. |
|
Filter criteria for Global IP Pools. Each list item is a filter dict. Within each filter dict, all keys use AND logic (e.g., Across filter dicts, OR logic is applied (a pool is included if it matches ANY filter dict). Example: If |
|
IP Pool name to filter global pools by exact name match. |
|
Pool type to filter global pools by type (Generic, Tunnel). Choices: |
|
Network management settings to filter by site. If To retrieve settings for specific sites, provide a |
|
List of site names to filter network management settings by site. Each site name must be the full hierarchy path (e.g., If not provided, defaults to the Global (root) site only. |
|
Reserve IP Pools to filter by pool name, site, site hierarchy, or pool type. |
|
Site hierarchy path to filter reserve pools by all child sites under the hierarchy. For example, "Global/USA" will include all sites under USA like "Global/USA/California", "Global/USA/New York", etc. This allows bulk extraction of reserve pools from multiple sites under a hierarchy. |
|
Site name to filter reserve pools by specific site. |
|
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"` |
|
Controls how config is written to the YAML file.
Relevant only when 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, |
|
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
SDK Methods used are - sites.Sites.get_site - network_settings.NetworkSettings.retrieves_global_ip_address_pools - network_settings.NetworkSettings.retrieves_ip_address_subpools - network_settings.NetworkSettings.retrieve_d_h_c_p_settings_for_a_site - network_settings.NetworkSettings.retrieve_d_n_s_settings_for_a_site - network_settings.NetworkSettings.retrieve_telemetry_settings_for_a_site - network_settings.NetworkSettings.retrieve_n_t_p_settings_for_a_site - network_settings.NetworkSettings.retrieve_time_zone_settings_for_a_site - network_settings.NetworkSettings.retrieve_aaa_settings_for_a_site - network_settings.NetworkSettings.retrieve_banner_settings_for_a_site - network_settings.NetworkSettings.get_device_controllability_settings
Paths used are - GET /dna/intent/api/v1/sites - GET /dna/intent/api/v1/ipam/globalIpAddressPools - GET /dna/intent/api/v1/ipam/siteIpAddressPools - GET /dna/intent/api/v1/sites/{id}/dhcpSettings - GET /dna/intent/api/v1/sites/{id}/dnsSettings - GET /dna/intent/api/v1/sites/{id}/telemetrySettings - GET /dna/intent/api/v1/sites/{id}/ntpSettings - GET /dna/intent/api/v1/sites/{id}/timeZoneSettings - GET /dna/intent/api/v1/sites/{id}/aaaSettings - GET /dna/intent/api/v1/sites/{id}/bannerSettings - GET /dna/intent/api/v1/networkDevices/deviceControllability/settings
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
# Auto-discovery mode: config omitted, all supported components discovered internally.
- name: Generate YAML Configuration with auto-discovery
cisco.dnac.network_settings_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
# Filtered mode: config provided with required component_specific_filters.
- name: Generate YAML Configuration for selected components
cisco.dnac.network_settings_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/network_settings_config.yml"
file_mode: "overwrite"
config:
component_specific_filters:
components_list:
- "global_pool_details"
- "reserve_pool_details"
global_pool_details:
- pool_name: "Global_Pool_1"
pool_type: "Generic"
reserve_pool_details:
- site_name: "Global/USA"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
A dictionary with the response when no configurations are found Returned: always |
|