Skip to content

Commit a482bb9

Browse files
authored
Merge pull request #330 from cisco-en-programmability/develop
Develop
2 parents edb0eee + ff7f86c commit a482bb9

172 files changed

Lines changed: 154500 additions & 3001 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,33 @@
55
- [ ] Documentation update
66

77
## Description
8-
Please include a summary of the changes and the related issue. Also, include relevant motivation and context.
98

10-
Bug Fix: [Brief description of the bug fixed]
11-
Root Cause (if applicable): [Explain what caused the bug]
12-
Fix Implemented: [Describe the fix applied]
9+
Summary:
10+
A brief description of the issue or bug.
1311

14-
Enhancement: [Brief description of the improvement/enhancement made]
15-
Enhancement Description: [Explain what was enhanced, why, and how]
16-
Impact Area: [Mention which part of the system/codebase is affected]
12+
Steps to Reproduce:
13+
Detailed steps that developers can follow to reproduce the issue.
14+
15+
Observed Behavior:
16+
What is currently happening, including error messages or symptoms.
17+
18+
Expected Behavior:
19+
What should happen under normal conditions.
20+
21+
Root Cause Analysis:
22+
Technical explanation of the underlying cause, if known.
23+
24+
Workaround:
25+
Any temporary solutions or mitigations available.
26+
27+
Fix Details:
28+
Description of the fix or code changes made.
29+
30+
Impact:
31+
Information on the scope and severity of the issue.
32+
33+
Additional Information:
34+
Logs, configuration snippets, environment details, or references to related bugs.
1735

1836
Testing Done:
1937
- [] Manual testing

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ test.yaml
2525
sanity_fixes.py
2626
.yamlfmt
2727
.github/copilot-instructions.md
28+
ai-assistant-catalyst-center-ansible-iac/

CONTRIBUTING.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Contributing
2+
3+
This document applies to the entire `cisco.dnac` collection and defines
4+
the coding and code review standards for Ansible modules.
5+
6+
## Core Principles
7+
8+
- Follow Ansible core module development standards.
9+
- Follow PEP 8 with a maximum of 100 characters per line.
10+
- Keep YAML `DOCUMENTATION` blocks to a maximum of 80 characters per
11+
line.
12+
- Code must be idempotent.
13+
- Avoid unnecessary complexity.
14+
- Use early returns for failure cases.
15+
- Keep logic linear and easy to follow.
16+
17+
## Ansible Module Structure
18+
19+
- Use `AnsibleModule` properly with `argument_spec`.
20+
- Validate required parameters via `argument_spec`, not manual checks.
21+
- Use `supports_check_mode=True` where applicable.
22+
- Respect `check_mode` and do not make changes in check mode.
23+
- Always return:
24+
- `changed` (`bool`)
25+
- `failed` (`bool`) when applicable
26+
- meaningful result data
27+
- Use `module.exit_json()` and `module.fail_json()`.
28+
- Do not raise raw exceptions. Wrap errors using `fail_json()`.
29+
- Ensure idempotency:
30+
- compare current state with desired state
31+
- set `changed=True` only when an actual change occurs
32+
33+
## Early Returns and Flow
34+
35+
- Use early return for:
36+
- validation failures
37+
- unsupported states
38+
- no-op and idempotent cases
39+
- Avoid nested `if`/`else` blocks where possible.
40+
- Keep execution flow sequential.
41+
42+
## Logging Standards
43+
44+
- Use `module.log()` for logging.
45+
- Do not use `print()` or the Python `logging` module.
46+
- Add an entry log describing the action.
47+
- Log input parameters, excluding sensitive data.
48+
- Do not log the function name directly.
49+
- Logs must describe the action.
50+
- Example: `Validating VLAN configuration for vlan_id=10`
51+
- Log major decision points.
52+
- Log external API calls and why they are made.
53+
- Never log passwords, tokens, or sensitive values.
54+
- Logs must explain why an action is happening.
55+
56+
## Documentation Requirements
57+
58+
### `DOCUMENTATION` Block
59+
60+
The `DOCUMENTATION` block must include:
61+
62+
- `module`
63+
- `short_description`
64+
- `description`
65+
- `version_added`
66+
- `options` with `type`, `required`, `default`, and `choices` where
67+
applicable
68+
- `author`
69+
70+
### `EXAMPLES` Block
71+
72+
- Keep examples minimal but meaningful.
73+
- Demonstrate idempotent usage.
74+
75+
### `RETURN` Block
76+
77+
- Document returned fields.
78+
- Include type and sample values.
79+
- Keep lines at 80 characters or fewer.
80+
81+
### Documentation Rules
82+
83+
- Be concise and accurate.
84+
- Keep descriptions clear and action-oriented.
85+
- Avoid unnecessary verbosity.
86+
- Follow consistent formatting across modules.
87+
88+
## API Review Instructions
89+
90+
- Review only the API logic.
91+
- In function docstrings include only:
92+
- short description
93+
- long description
94+
- `Args`
95+
- `Returns`
96+
- Do not include extra explanation.
97+
98+
## Code Quality and Maintainability
99+
100+
- Avoid redundant key lookups.
101+
- Avoid repeated validations.
102+
- Use helper functions only if they are reusable.
103+
- Do not split logic unnecessarily.
104+
- Keep state comparison clean and explicit.
105+
- Suggest better naming if unclear, but do not modify directly.
106+
- Ensure consistent naming patterns such as `success_count` and
107+
`failed_count`.
108+
109+
## Error Handling
110+
111+
- Use `fail_json(msg=..., details=...)` where helpful.
112+
- Provide actionable error messages.
113+
- Include relevant identifiers in errors.
114+
- Avoid generic error messages.
115+
116+
## Security Considerations
117+
118+
- Mark sensitive parameters with `no_log=True`.
119+
- Never log sensitive data.
120+
- Avoid exposing secrets in return values.
121+
- Validate input types strictly.
122+
123+
## Performance and Scalability
124+
125+
- Avoid unnecessary API calls.
126+
- Cache fetched state when possible.
127+
- Minimize repeated lookups.
128+
- Prefer bulk operations when supported.
129+
130+
## Suggestions Policy
131+
132+
When suggesting improvements during review, suggestions may cover:
133+
134+
- refactoring
135+
- optimization
136+
- documentation
137+
- tests
138+
- security
139+
- performance
140+
- readability
141+
- maintainability
142+
- scalability
143+
- compatibility
144+
- best practices
145+
- design patterns
146+
- architecture
147+
- conventions
148+
- anti-patterns
149+
150+
Suggestions must:
151+
152+
- be clear and actionable
153+
- not directly modify original code
154+
- preserve structure unless reuse justifies refactoring

changelogs/changelog.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,3 +1985,23 @@ releases:
19851985
- Changes in template_workflow_manager module
19861986
- Changes in wired_campus_automation_workflow_manager module
19871987
- Changes in wireless_design_workflow_manager module
1988+
1989+
6.49.0:
1990+
release_date: "2026-03-26"
1991+
changes:
1992+
release_summary: Added playbook config generator modules and shared helper
1993+
enhancements for workflow manager modules
1994+
minor_changes:
1995+
- Added playbook config generator modules for access point, application
1996+
policy, assurance, backup and restore, device credential, discovery,
1997+
events and notifications, inventory, ISE radius integration, network
1998+
profile, network settings, PnP, provision, and RMA workflows.
1999+
- Added playbook config generator modules for SDA fabric, SDA
2000+
extranet policies, SDA host port onboarding, site, tags, template,
2001+
user role, wired campus automation, and wireless design workflows.
2002+
- Added shared brownfield helper support, config validation, and
2003+
component filter deduplication for playbook config generator modules.
2004+
- Added device_ips, serial_numbers, and hostnames filters to
2005+
sda_host_port_onboarding_playbook_config_generator.
2006+
- Updated related workflow manager modules to align with the new
2007+
playbook config generator design.

galaxy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
namespace: cisco
33
name: dnac
4-
version: 6.48.2
4+
version: 6.49.0
55
readme: README.md
66
authors:
77
- Rafael Campos <rcampos@cloverhound.com>
@@ -31,6 +31,9 @@ authors:
3131
- Karthick S N <kasn@cisco.com>
3232
- Sunil Shatagopa <sshatago@cisco.com>
3333
- Vivek Raj Penke <vpenke@cisco.com>
34+
- Vidhya Rathinam <virathin@cisco.com>
35+
- Mridul Saurabh <msaurabh@cisco.com>
36+
- Jeet Ram <jeeram@cisco.com>
3437

3538
description: "DEPRECATED - Use cisco.catalystcenter instead. Ansible Modules for Cisco DNA Center."
3639
license_file: "LICENSE"
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
- name: Generate access point location playbook configuration from Cisco Catalyst Center
3+
hosts: localhost
4+
connection: local
5+
gather_facts: false
6+
vars_files:
7+
- "credentials.yml"
8+
tasks:
9+
# Example 1: Generate all access point location configurations
10+
- name: Generate complete access point location configuration
11+
cisco.dnac.accesspoint_location_playbook_config_generator:
12+
dnac_host: "{{ dnac_host }}"
13+
dnac_username: "{{ dnac_username }}"
14+
dnac_password: "{{ dnac_password }}"
15+
dnac_verify: "{{ dnac_verify }}"
16+
dnac_port: "{{ dnac_port }}"
17+
dnac_version: "{{ dnac_version }}"
18+
dnac_debug: "{{ dnac_debug }}"
19+
dnac_log: true
20+
dnac_log_level: DEBUG
21+
dnac_api_task_timeout: 1000
22+
dnac_task_poll_interval: 1
23+
state: gathered
24+
file_path: "tmp/accesspoint_location_workflow_playbook.yml"
25+
file_mode: append
26+
27+
# Example 2: Generate access point location configurations by sites
28+
- name: Generate access point location configurations by sites
29+
cisco.dnac.accesspoint_location_playbook_config_generator:
30+
dnac_host: "{{ dnac_host }}"
31+
dnac_username: "{{ dnac_username }}"
32+
dnac_password: "{{ dnac_password }}"
33+
dnac_verify: "{{ dnac_verify }}"
34+
dnac_port: "{{ dnac_port }}"
35+
dnac_version: "{{ dnac_version }}"
36+
dnac_debug: "{{ dnac_debug }}"
37+
dnac_log: true
38+
dnac_log_level: DEBUG
39+
dnac_api_task_timeout: 1000
40+
dnac_task_poll_interval: 1
41+
state: gathered
42+
file_path: "tmp/accesspoint_location_workflow_playbook_site_base.yml"
43+
file_mode: "append"
44+
config:
45+
global_filters:
46+
site_list:
47+
- Global/USA/SAN JOSE/SJ_BLD23/FLOOR1
48+
- Global/USA/SAN JOSE/SJ_BLD23/FLOOR2
49+
- Global/USA/SAN JOSE/SJ_BLD23/FLOOR4
50+
51+
# Example 3: Generate access point location configurations by planned APs
52+
- name: Generate access point location configurations by planned APs
53+
cisco.dnac.accesspoint_location_playbook_config_generator:
54+
dnac_host: "{{ dnac_host }}"
55+
dnac_username: "{{ dnac_username }}"
56+
dnac_password: "{{ dnac_password }}"
57+
dnac_verify: "{{ dnac_verify }}"
58+
dnac_port: "{{ dnac_port }}"
59+
dnac_version: "{{ dnac_version }}"
60+
dnac_debug: "{{ dnac_debug }}"
61+
dnac_log: true
62+
dnac_log_level: DEBUG
63+
dnac_api_task_timeout: 1000
64+
dnac_task_poll_interval: 1
65+
state: gathered
66+
file_path: "tmp/accesspoint_location_workflow_playbook_PAP_base.yml"
67+
file_mode: "append"
68+
config:
69+
global_filters:
70+
planned_accesspoint_list:
71+
- ap_test_auto-1
72+
- ap_test_auto-3
73+
74+
# Example 4: Generate access point location configurations by real APs
75+
- name: Generate access point location configurations by real APs
76+
cisco.dnac.accesspoint_location_playbook_config_generator:
77+
dnac_host: "{{ dnac_host }}"
78+
dnac_username: "{{ dnac_username }}"
79+
dnac_password: "{{ dnac_password }}"
80+
dnac_verify: "{{ dnac_verify }}"
81+
dnac_port: "{{ dnac_port }}"
82+
dnac_version: "{{ dnac_version }}"
83+
dnac_debug: "{{ dnac_debug }}"
84+
dnac_log: true
85+
dnac_log_level: DEBUG
86+
dnac_api_task_timeout: 1000
87+
dnac_task_poll_interval: 1
88+
state: gathered
89+
file_path: "tmp/accesspoint_location_workflow_playbook_real_ap_base.yml"
90+
file_mode: "append"
91+
config:
92+
global_filters:
93+
real_accesspoint_list:
94+
- AP687D.B402.1614-AP-Test6
95+
- Cisco_9120AXE_IP4-01-Test2
96+
97+
# Example 5: Generate access point location configurations by access point models
98+
- name: Generate access point location configurations by AP models
99+
cisco.dnac.accesspoint_location_playbook_config_generator:
100+
dnac_host: "{{ dnac_host }}"
101+
dnac_username: "{{ dnac_username }}"
102+
dnac_password: "{{ dnac_password }}"
103+
dnac_verify: "{{ dnac_verify }}"
104+
dnac_port: "{{ dnac_port }}"
105+
dnac_version: "{{ dnac_version }}"
106+
dnac_debug: "{{ dnac_debug }}"
107+
dnac_log: true
108+
dnac_log_level: DEBUG
109+
dnac_api_task_timeout: 1000
110+
dnac_task_poll_interval: 1
111+
state: gathered
112+
file_path: "tmp/accesspoint_location_workflow_playbook_accesspoint_model_base.yml"
113+
file_mode: "overwrite"
114+
config:
115+
global_filters:
116+
accesspoint_model_list:
117+
- AP9120E
118+
- CW9172I
119+
120+
# Example 6: Generate access point location configurations by MAC addresses
121+
- name: Generate access point location configurations by MAC addresses
122+
cisco.dnac.accesspoint_location_playbook_config_generator:
123+
dnac_host: "{{ dnac_host }}"
124+
dnac_username: "{{ dnac_username }}"
125+
dnac_password: "{{ dnac_password }}"
126+
dnac_verify: "{{ dnac_verify }}"
127+
dnac_port: "{{ dnac_port }}"
128+
dnac_version: "{{ dnac_version }}"
129+
dnac_debug: "{{ dnac_debug }}"
130+
dnac_log: true
131+
dnac_log_level: DEBUG
132+
dnac_api_task_timeout: 1000
133+
dnac_task_poll_interval: 1
134+
state: gathered
135+
file_path: "tmp/accesspoint_location_workflow_playbook_mac_address_base.yml"
136+
file_mode: "overwrite"
137+
config:
138+
global_filters:
139+
mac_address_list:
140+
- cc:6e:2a:e1:02:40

0 commit comments

Comments
 (0)