-
Notifications
You must be signed in to change notification settings - Fork 32
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
base: master
Are you sure you want to change the base?
Conversation
4f77f85
to
d5cfb35
Compare
d5cfb35
to
bca2eee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ad06fce
to
e953212
Compare
e953212
to
0e6144b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tests/integration/targets/ndo_virtual_port_channel_interface/tasks/main.yml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
af7cd75
8dbc55e
to
af7cd75
Compare
There was a problem hiding this 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
…r possible empty strings attributes.
…riptions for payload data.
…t_channel_interfaces.
…rtual_port_channel_interface.py module to be consistent with future modules.
…t_channel_interface module. enhance format_interface_descriptions function to format range of interface IDs.
…ort_channel_interface module. Modify Documentation and Example sections.
…rface module when handling null value.
af7cd75
to
5ccdfdf
Compare
…s being updated or created for ndo_virtual_port_channel_interface module.
5ccdfdf
to
94aba9f
Compare
register: virtual_port_channel_interface_1 | ||
|
||
- name: Update a Virtual Port Channel Interface's interfaces and their descriptions | ||
cisco.mso.ndo_port_channel_interface: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 = { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
}
}
}
node_1: 101 | ||
node_2: 102 |
There was a problem hiding this comment.
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
.
resolves #467
New Modules Added: