Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new module to manage Virtual Port Channel Interfaces in Fabric Resource Policies Template. (DCNE-53) #551

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

gmicol
Copy link
Collaborator

@gmicol gmicol commented Oct 11, 2024

resolves #467

New Modules Added:

  • ndo_virtual_port_channel_interface

@gmicol gmicol added enhancement New feature or request jira-sync Sync this issue to Jira labels Oct 11, 2024
@gmicol gmicol self-assigned this Oct 11, 2024
@gmicol gmicol force-pushed the mso_vpc_interface branch from 4f77f85 to d5cfb35 Compare October 28, 2024 17:20
@gmicol gmicol force-pushed the mso_vpc_interface branch from d5cfb35 to bca2eee Compare October 29, 2024 00:14
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
@gmicol gmicol requested a review from akinross October 29, 2024 17:27
@gmicol gmicol requested a review from akinross October 30, 2024 18:02
akinross
akinross previously approved these changes Oct 31, 2024
Copy link
Collaborator

@akinross akinross left a comment

Choose a reason for hiding this comment

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

LGTM

plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
plugins/modules/ndo_virtual_port_channel_interface.py Outdated Show resolved Hide resolved
@gmicol gmicol force-pushed the mso_vpc_interface branch 2 times, most recently from ad06fce to e953212 Compare November 1, 2024 17:03
@gmicol gmicol requested review from shrsr and akinross November 1, 2024 17:03
@gmicol gmicol force-pushed the mso_vpc_interface branch from e953212 to 0e6144b Compare November 1, 2024 17:48
akinross
akinross previously approved these changes Nov 5, 2024
Copy link
Collaborator

@akinross akinross left a comment

Choose a reason for hiding this comment

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

LGTM

samiib
samiib previously approved these changes Dec 13, 2024
Copy link
Collaborator

@samiib samiib left a comment

Choose a reason for hiding this comment

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

LGTM

akinross
akinross previously approved these changes Dec 13, 2024
Copy link
Collaborator

@akinross akinross left a comment

Choose a reason for hiding this comment

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

LGTM

anvitha-jain
anvitha-jain previously approved these changes Dec 17, 2024
Copy link
Collaborator

@anvitha-jain anvitha-jain left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@shrsr shrsr left a comment

Choose a reason for hiding this comment

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

I'm curious as to what would happen in this scenario where node_1 is not mentioned in the second config and interfaces_1 is changed to 1/2? Likely node_1 would be sent in the payload as null and NDO would complain in the response? If yes, then we need to modify the append_update_ops_data() a little...

- name: Create a new virtual port channel interface 
      cisco.mso.ndo_virtual_port_channel_interface: 
        <<: *mso_info
        template: ansible_fabric_resource_template
        virtual_port_channel_interface: ansible_virtual_port_channel_interface
        description: Ansible Virtual Port Channel test
        node_1: 101
        node_2: 102
        interfaces_1: 1/1
        interfaces_2: 1/1
        interface_policy_group: 
          name: ansible_test_interface_policy_group_port_channel
          template: ansible_fabric_policy_template
        interface_descriptions:
          - node: 101
            interface_id: 1/1
            description: first Ansible interface test for first node
          - node: 102
            interface_id: 1/1
            description: first Ansible interface test for second node
        state: present

- name: Create a new virtual port channel interface with change in interfaces
      cisco.mso.ndo_virtual_port_channel_interface: 
        <<: *mso_info
        template: ansible_fabric_resource_template
        virtual_port_channel_interface: ansible_virtual_port_channel_interface
        description: Ansible Virtual Port Channel test
        node_2: 102
        interfaces_1: 1/2
        interfaces_2: 1/1
        interface_policy_group: 
          name: ansible_test_interface_policy_group_port_channel
          template: ansible_fabric_policy_template
        interface_descriptions:
          - node: 101
            interface_id: 1/1
            description: first Ansible interface test for first node
          - node: 102
            interface_id: 1/1
            description: first Ansible interface test for second node
        state: present

@gmicol gmicol requested a review from shrsr December 19, 2024 16:00
…s being updated or created for ndo_virtual_port_channel_interface module.
register: virtual_port_channel_interface_1

- name: Update a Virtual Port Channel Interface's interfaces and their descriptions
cisco.mso.ndo_port_channel_interface:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cisco.mso.ndo_port_channel_interface:
cisco.mso.ndo_virtual_port_channel_interface:

state: present

- name: Update a Virtual Port Channel Interface by mirroring node 1 and node 2 interfaces
cisco.mso.ndo_port_channel_interface:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cisco.mso.ndo_port_channel_interface:
cisco.mso.ndo_virtual_port_channel_interface:

interface_policy_group_uuid = fabric_policy_template.get_interface_policy_group_uuid(interface_policy_group.get("name"))

if mso.existing:
mso_values = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use dict() instead of {}.

name=name,
description=description,
node1Details=dict(
node=node_1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

When you do not provide node_1 and node_2. I got the below value, and the task failed. Also, check the update part.

{
    "op": "add",
    "path": "/fabricResourceTemplate/template/virtualPortChannels/-",
    "value": {
        "description": "Ansible Virtual Port Channel test",
        "interfaceDescriptions": [],
        "name": "ansible_virtual_port_channel_interface",
        "node1Details": {
            "memberInterfaces": "1/1",
            "node": null
        },
        "node2Details": {
            "memberInterfaces": "1/1",
            "node": null
        }
    }
}

Comment on lines +92 to +93
node_1: 101
node_2: 102
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a create task without proving node_1 and node_2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jira-sync Sync this issue to Jira
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: New module for Virtual Port Channel Interface in Fabric Resource Policies Template (DCNE-53)
6 participants