-
Notifications
You must be signed in to change notification settings - Fork 127
Description
Feature Request: Enhanced Resource Module State Support for Cisco NX-OS Collection
Summary
Request to add comprehensive resource module state support (gathered, parsed, rendered) to legacy and configuration modules in the cisco.nxos collection to align with modern Ansible network automation standards and improve configuration management capabilities.
Issue Type
- Feature Request
Component Name
cisco.nxos collection - Multiple modules requiring state support enhancement
Background
The cisco.nxos collection contains numerous modules that lack modern resource module state support, limiting their utility in contemporary network automation workflows. Many modules only support basic present/absent or enabled/disabled states, while modern network automation requires advanced capabilities for configuration gathering, parsing, and rendering.
Affected Modules
Category 1: Legacy Modules (Only present/absent states)
- nxos_banner - Banner configuration management
- nxos_feature - Feature enable/disable management
- nxos_evpn_global - EVPN global configuration
- nxos_overlay_global - Overlay global configuration
- nxos_system - System configuration
- nxos_user - User management
- nxos_vtp_domain - VTP domain configuration
- nxos_vtp_password - VTP password configuration
- nxos_vtp_version - VTP version configuration
Category 2: Configuration Modules (No state parameter)
- nxos_bfd_global - BFD global configuration
- nxos_igmp - IGMP global configuration
- nxos_igmp_interface - IGMP interface configuration
- nxos_igmp_snooping - IGMP snooping configuration
- nxos_pim - PIM configuration
- nxos_pim_interface - PIM interface configuration
- nxos_pim_rp_address - PIM RP address configuration
- nxos_udld - UDLD global configuration
- nxos_udld_interface - UDLD interface configuration
Category 3: Infrastructure Modules (Limited state support)
- nxos_vpc - VPC global configuration
- nxos_vpc_interface - VPC interface configuration
- nxos_vxlan_vtep - VXLAN VTEP configuration
- nxos_vxlan_vtep_vni - VXLAN VNI configuration
- nxos_vrrp - VRRP configuration
Requested State Support
1. gathered State
Purpose: Collect current configuration from network devices
Use Cases:
- Configuration backup and documentation
- Drift detection and compliance checking
- Migration planning and assessment
- Inventory and audit operations
Example Implementation:
- name: Gather current banner configuration
cisco.nxos.nxos_banner:
state: gathered
register: current_banners
- name: Gather all feature states
cisco.nxos.nxos_feature:
state: gathered
register: current_features
- name: Gather BFD global configuration
cisco.nxos.nxos_bfd_global:
state: gathered
register: current_bfd_config2. parsed State
Purpose: Parse configuration from provided text/configuration snippets
Use Cases:
- Configuration analysis and validation
- Migration from text-based configurations
- Integration with external configuration management systems
- Testing and development workflows
Example Implementation:
- name: Parse banner configuration from text
cisco.nxos.nxos_banner:
running_config: |
banner motd ^
Welcome to the Corporate Network
Unauthorized access is prohibited
^
state: parsed
register: parsed_banner
- name: Parse feature configuration
cisco.nxos.nxos_feature:
running_config: |
feature ospf
feature bgp
feature vpc
no feature telnet
state: parsed
register: parsed_features
- name: Parse BFD configuration
cisco.nxos.nxos_bfd_global:
running_config: |
bfd interval 100 min_rx 100 multiplier 3
bfd slow-timer 3000
bfd echo-interface loopback0
state: parsed
register: parsed_bfd3. rendered State
Purpose: Generate configuration commands from structured data
Use Cases:
- Configuration template generation
- CI/CD pipeline integration
- Configuration validation before deployment
- Documentation and change management
Example Implementation:
- name: Render banner commands
cisco.nxos.nxos_banner:
config:
banner: motd
text: |
Welcome to {{ site_name }}
Contact: {{ admin_email }}
state: rendered
register: banner_commands
- name: Render feature commands
cisco.nxos.nxos_feature:
config:
- feature: ospf
state: enabled
- feature: bgp
state: enabled
- feature: telnet
state: disabled
state: rendered
register: feature_commands
- name: Render BFD configuration
cisco.nxos.nxos_bfd_global:
config:
interval:
tx: 100
min_rx: 100
multiplier: 3
slow_timer: 3000
echo_interface: loopback0
state: rendered
register: bfd_commandsBusiness Justification
1. Configuration Management Enhancement
- Backup and Restore: Enable automated configuration backup and restore workflows
- Drift Detection: Facilitate continuous compliance monitoring
- Change Management: Improve change tracking and rollback capabilities
2. DevOps Integration
- CI/CD Pipelines: Support infrastructure-as-code practices
- Testing: Enable configuration testing in development environments
- Documentation: Automate network documentation generation
3. Operational Efficiency
- Standardization: Align with modern Ansible network automation patterns
- Consistency: Provide uniform interface across all cisco.nxos modules
- Scalability: Support large-scale network automation deployments
4. Migration Support
- Legacy Integration: Facilitate migration from legacy configuration management
- Multi-vendor: Support hybrid network environments
- Gradual Adoption: Enable incremental automation adoption
Implementation Approach
Phase 1: High-Priority Modules (Q1)
- nxos_banner
- nxos_feature
- nxos_bfd_global
- nxos_vpc
- nxos_system
Phase 2: Protocol Modules (Q2)
- nxos_igmp*
- nxos_pim*
- nxos_udld*
- nxos_vrrp
Phase 3: Infrastructure Modules (Q3)
- nxos_vxlan_vtep*
- nxos_overlay_global
- nxos_evpn_global
- nxos_vtp_*
Expected Return Structure
gathered State Return
gathered:
- banner: motd
text: "Welcome to the network"
state: present
- banner: exec
state: absentparsed State Return
parsed:
- banner: motd
text: "Welcome to the network"
- banner: exec
text: "Executive access granted"rendered State Return
rendered:
- "banner motd @"
- "Welcome to the network"
- "@"
- "no banner exec"Testing Requirements
Unit Tests
- State-specific test cases for each module
- Configuration parsing validation
- Command generation verification
- Error handling scenarios
Integration Tests
- End-to-end workflow testing
- Multi-state operation validation
- Platform compatibility verification
- Performance impact assessment
Documentation Requirements
Module Documentation
- State parameter documentation
- Usage examples for each state
- Return value specifications
- Platform compatibility notes
User Guides
- Migration guide from legacy usage
- Best practices documentation
- Troubleshooting guide
- Integration examples
Compatibility Considerations
Backward Compatibility
- Maintain existing functionality
- Default behavior preservation
- Deprecation warnings where appropriate
- Migration path documentation
Platform Support
- NX-OS version compatibility
- Platform-specific limitations
- Feature availability matrix
- Testing coverage requirements
Success Criteria
Functional Requirements
- All specified modules support gathered/parsed/rendered states
- Consistent behavior across modules
- Comprehensive error handling
- Performance within acceptable limits
Quality Requirements
- 100% test coverage for new functionality
- Documentation completeness
- Code review approval
- Community feedback incorporation
Community Impact
Benefits
- Enhanced automation capabilities
- Improved user experience
- Better alignment with Ansible standards
- Increased adoption potential
Migration Support
- Comprehensive migration documentation
- Example playbooks and use cases
- Community workshops and training
- Gradual deprecation timeline
Conclusion
Adding comprehensive resource module state support to the cisco.nxos collection will significantly enhance its utility for modern network automation workflows. This enhancement aligns with Ansible's network automation standards and provides users with powerful tools for configuration management, compliance monitoring, and DevOps integration.
The phased implementation approach ensures manageable development cycles while delivering value incrementally. The investment in this enhancement will position the cisco.nxos collection as a leading solution for Cisco NX-OS automation.
Status
- Priority: High
- Complexity: Medium-High
- Community Interest: High
- Maintenance Impact: Medium
Created: July 13, 2025
Author: Tukaisg
Version: 1.1
Next Review: August 13, 2025