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

config

dictionary

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 component_specific_filters is accepted.

component_specific_filters

dictionary / required

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 config is provided.

components_list

list / elements=string

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 components_list, the module auto-adds it internally.

Example ["global_pool_details", "reserve_pool_details", "network_management_details"]

Choices:

device_controllability_details

list / elements=dictionary

Device controllability settings to filter by site.

global_pool_details

list / elements=dictionary

Filter criteria for Global IP Pools. Each list item is a filter dict.

Within each filter dict, all keys use AND logic (e.g., pool_name AND pool_type must both match).

Across filter dicts, OR logic is applied (a pool is included if it matches ANY filter dict).

Example: - pool_name: X, pool_type: LAN and - pool_name: Y, pool_type: Generic will include pools matching (name=X AND type=LAN) OR (name=Y AND type=Generic).

If global_pool_details sub-filter is not provided under component_specific_filters, all global pools are included.

pool_name

string

IP Pool name to filter global pools by exact name match.

pool_type

string

Pool type to filter global pools by type (Generic, Tunnel).

Choices:

network_management_details

list / elements=dictionary

Network management settings to filter by site.

If network_management_details sub-filter is not provided under component_specific_filters, the module defaults to retrieving settings for the Global (root) site only.

To retrieve settings for specific sites, provide a site_name_list with the desired site names.

site_name_list

list / elements=string

List of site names to filter network management settings by site.

Each site name must be the full hierarchy path (e.g., Global/USA, Global/USA/California).

If not provided, defaults to the Global (root) site only.

reserve_pool_details

list / elements=dictionary

Reserve IP Pools to filter by pool name, site, site hierarchy, or pool type.

site_hierarchy

string

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

string

Site name to filter reserve pools by specific site.

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

Controls how config is written to the YAML file.

overwrite replaces existing file content.

append appends generated YAML content to the existing file.

Relevant only when file_path is provided.

Choices:

file_path

string

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 network_settings_playbook_config_<YYYY-MM-DD_HH-MM-SS>.yml.

For example, network_settings_playbook_config_2026-01-24_12-33-20.yml.

state

string

The desired state of Cisco Catalyst Center after module execution.

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 - 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_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

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

response_1

dictionary

response_2

dictionary

response_3

dictionary

Authors

  • Megha Kandari (@kandarimegha)

  • Madhan Sankaranarayanan (@madhansansel)