cisco.dnac.application_policy_playbook_config_generator module -- Generate YAML configurations playbook for 'application_policy_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.application_policy_playbook_config_generator.
New in cisco.dnac 6.44.0
Synopsis
Generates YAML configurations compatible with the 'application_policy_workflow_manager' module, reducing the effort required to manually create Ansible playbooks.
The YAML configurations generated represent the application policies and queuing profiles deployed in the Cisco Catalyst Center.
Supports extraction of Queuing Profiles and Application Policies.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk >= 2.9.3
python >= 3.9
Parameters
Parameter |
Comments |
|---|---|
A dictionary of filters for generating YAML playbook compatible with the 'application_policy_workflow_manager' module. Filters specify which components to include in the YAML configuration file. When provided, only To generate all configurations, omit |
|
Filters to specify which application policy components to include in the YAML configuration file. Allows granular selection of specific components and their parameters. Mandatory when |
|
Specific application policy filtering options. Allows extraction of only specific policies by name. |
|
List of specific application policy names to extract. Only policies in this list will be included in the generated configuration. Example ["wired_traffic_policy", "wireless_traffic_policy"] |
|
List of components to include in the YAML configuration file. Valid values are ["queuing_profile", "application_policy"] Required and non-empty when no component-specific filter block is provided. If component-specific filters are provided, missing components are auto-added. Choices: |
|
Specific queuing profile filtering options. Allows extraction of only specific queuing profiles by name. |
|
List of specific queuing profile names to extract. Only profiles in this list will be included in the generated configuration. Example ["Enterprise-QoS-Profile", "Wireless-QoS-Profile"] |
|
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"` |
|
Specifies the file write mode for the generated YAML configuration file. Relevant only when When set to When set to |
|
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 "application_policy_workflow_manager_playbook_<DD_Mon_YYYY_HH_MM_SS_MS>.yml". |
|
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 - application_policy.ApplicationPolicy.get_application_policy - application_policy.ApplicationPolicy.get_application_policy_queuing_profile
Paths used are - GET /dna/intent/api/v1/app-policy - GET /dna/intent/api/v1/app-policy-queuing-profile
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: Generate all application policy configurations
cisco.dnac.application_policy_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
- name: Generate configurations with custom file path
cisco.dnac.application_policy_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/app_policy_config.yml"
- name: Generate specific queuing profiles
cisco.dnac.application_policy_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/queuing_profiles.yml"
config:
component_specific_filters:
components_list: ["queuing_profile"]
queuing_profile:
profile_names_list: ["Enterprise-QoS-Profile", "Wireless-QoS"]
- name: Generate specific application policies
cisco.dnac.application_policy_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/app_policies.yml"
config:
component_specific_filters:
components_list: ["application_policy"]
application_policy:
policy_names_list: ["wired_traffic_policy"]
- name: Generate both queuing profiles and policies with filters
cisco.dnac.application_policy_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/complete_app_policy_config.yml"
config:
component_specific_filters:
components_list: ["queuing_profile", "application_policy"]
queuing_profile:
profile_names_list: ["Enterprise-QoS-Profile"]
application_policy:
policy_names_list: ["wired_traffic_policy", "wireless_traffic_policy"]
- name: Generate configurations in append mode
cisco.dnac.application_policy_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/app_policy_config.yml"
file_mode: append
config:
component_specific_filters:
components_list: ["queuing_profile"]
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Successful YAML configuration generation Returned: always |