You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Currently, the vlan parameter is required regardless of the state value. This causes unnecessary constraints and potential errors when the state is set to absent. The vlan parameter should be optional when the state is absent. The current workaround for the users is to put random VLAN numbers to get past the check.
Only pod, leaf and path should be enough to remove the static port.
Steps to Reproduce:
Set the state parameter to absent. (with the existing resource on NDO)
Do not provide a vlan parameter.
Observe the error indicating that the vlan parameter is required.
Option 1: Using static_ports
- name: EPG Static Ports Bindinghosts: msoconnection: localgather_facts: falsetasks:
- name: Remove a static port from a site EPGcisco.mso.mso_schema_site_anp_epg_staticport:
host: "{{ ansible_host }}"username: "{{ username }}"password: "{{ password }}"schema: "noppanut-test-schema-01"site: "apic-a"template: "noppanut-test-template-01"anp: AP1epg: EPG-Astatic_ports:
- pod: pod-1leaf: 101path: eth1/1# vlan: 3003deployment_immediacy: immediatestate: absent
Option 2: Global config
- name: EPG Static Ports Bindinghosts: msoconnection: localgather_facts: falsetasks:
- name: Remove a static port from a site EPGcisco.mso.mso_schema_site_anp_epg_staticport:
host: "{{ ansible_host }}"username: "{{ username }}"password: "{{ password }}"schema: "noppanut-test-schema-01"site: "apic-a"template: "noppanut-test-template-01"anp: AP1epg: EPG-Apod: pod-1leaf: 101path: eth1/1# vlan: 3003deployment_immediacy: immediatestate: absent
Expected Behavior:
When the state is absent, the vlan parameter should not be required, and the code should handle its absence gracefully.
Actual Behavior:
An error is thrown indicating that the vlan parameter is required even when the state is absent.
Proposed Solution:
Update the code to make the vlan parameter optional when the state is absent. Add appropriate checks to handle the absence of the vlan parameter.
Additional Context:
This change will improve the flexibility and usability of the module by removing unnecessary constraints when the state is absent. The user doesn't need to look up the VLAN or put random VLAN IDs.
github-actionsbot
changed the title
[EPG Static Port] Make VLAN parameter optional when the state is absent
[EPG Static Port] Make VLAN parameter optional when the state is absent (DCNE-300)
Jan 29, 2025
Community Note
Description
Currently, the
vlan
parameter is required regardless of thestate
value. This causes unnecessary constraints and potential errors when thestate
is set toabsent
. Thevlan
parameter should be optional when thestate
isabsent
. The current workaround for the users is to put random VLAN numbers to get past the check.Only
pod
,leaf
andpath
should be enough to remove the static port.Steps to Reproduce:
state
parameter toabsent
. (with the existing resource on NDO)vlan
parameter.vlan
parameter is required.Option 1: Using
static_ports
Option 2: Global config
Expected Behavior:
When the
state
isabsent
, thevlan
parameter should not be required, and the code should handle its absence gracefully.Actual Behavior:
An error is thrown indicating that the
vlan
parameter is required even when thestate
isabsent
.Proposed Solution:
Update the code to make the
vlan
parameter optional when thestate
isabsent
. Add appropriate checks to handle the absence of thevlan
parameter.Additional Context:
This change will improve the flexibility and usability of the module by removing unnecessary constraints when the
state
is absent. The user doesn't need to look up the VLAN or put random VLAN IDs.New or Affected Module(s):
mso_schema_site_anp_epg_staticport
Collection versions
References
The text was updated successfully, but these errors were encountered: