Skip to content

Conversation

@rukapse
Copy link

@rukapse rukapse commented Oct 22, 2025

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Description

New module that Generates YAML configurations compatible with the 'wired_campus_automation_workflow_manager'
module, reducing the effort required to manually create Ansible playbooks and
enabling programmatic modifications.

  • The YAML configurations generated represent the layer 2 configurations deployed
    on network devices within the Cisco Catalyst Center.
  • Supports extraction of VLANs, CDP, LLDP, STP, VTP, DHCP Snooping, IGMP Snooping,
    MLD Snooping, Authentication, Logical Ports, and Port Configuration settings.

Testing Done:

  • Manual testing
  • Unit tests
  • Integration tests

Test cases covered: [Mention test case IDs or brief points]

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • All the sanity checks have been completed and the sanity test cases have been executed

Ansible Best Practices

  • Tasks are idempotent (can be run multiple times without changing state)
  • Variables and secrets are handled securely (e.g., using ansible-vault or environment variables)
  • Playbooks are modular and reusable
  • Handlers are used for actions that need to run on change

Documentation

  • All options and parameters are documented clearly.
  • Examples are provided and tested.
  • Notes and limitations are clearly stated.

Screenshots (if applicable)

Notes to Reviewers

@rukapse rukapse requested a review from madhansansel as a code owner October 22, 2025 03:39
Comment on lines +683 to +687
from ansible_collections.cisco.dnac.plugins.module_utils.dnac import (
DnacBase,
validate_list_of_dicts,
)
import time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validate_list_of_dicts from dnac is outdated. Please make sure to import it from ansible_collections.cisco.dnac.plugins.module_utils.validation and test the workflow one again for all the cases.

Comment on lines +1 to +30
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)
import datetime
import os
try:
import yaml
HAS_YAML = True
except ImportError:
HAS_YAML = False
yaml = None
from collections import OrderedDict

if HAS_YAML:
class OrderedDumper(yaml.Dumper):
def represent_dict(self, data):
return self.represent_mapping("tag:yaml.org,2002:map", data.items())

OrderedDumper.add_representer(OrderedDict, OrderedDumper.represent_dict)
else:
OrderedDumper = None
__metaclass__ = type
from abc import ABCMeta


class BrownFieldHelper():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rukapse , please run Black formatter on the code to maintain consistency across the repository.

To enable this, install the Black formatter extension and add the following to your user settings JSON:

    "[python]": {
        //....Some existing settings
        "editor.defaultFormatter": "ms-python.black-formatter",
        "editor.formatOnSave": true
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants