mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Decouple config and state check in vlan and vrf network modules (#36386)
* Decouple config and state check in {network_os }_vlan and { network_os }_vrf modules Fixes #35567 Fixes #34754 `interfaces` option is used for configuration as well as operational state check. If interface is configured to given vlan or vrf but if operational state of interface is disabled it results in module failure. Fix is to decouple same option usage for config and state. With this fix `interfaces` is used as config option and a new option named `associated_interfaces` will be used for intent check for assigned interfaces. * Fix CI failures * Fix review comment * Fixed integration test failure
This commit is contained in:
parent
215c80f9dc
commit
5a6b893240
13 changed files with 457 additions and 100 deletions
|
@ -64,18 +64,22 @@
|
|||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- name: Assign interfaces to VRF
|
||||
- name: Assign interfaces to VRF (Config + intent)
|
||||
nxos_vrf: &interfaces
|
||||
name: test1
|
||||
interfaces:
|
||||
- "{{ testint1 }}"
|
||||
- "{{ testint2 }}"
|
||||
associated_interfaces:
|
||||
- "{{ testint1 }}"
|
||||
- "{{ testint2 }}"
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 'result.changed == true'
|
||||
- "result.failed == false"
|
||||
- '"interface {{ testint1 }}" in result.commands'
|
||||
- '"vrf member test1" in result.commands'
|
||||
- '"interface {{ testint2 }}" in result.commands'
|
||||
|
@ -89,6 +93,32 @@
|
|||
that:
|
||||
- 'result.changed == false'
|
||||
|
||||
- name: Check interfaces assigned to VRF (intent)
|
||||
nxos_vrf:
|
||||
name: test1
|
||||
associated_interfaces:
|
||||
- "{{ testint1 }}"
|
||||
- "{{ testint2 }}"
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == false"
|
||||
|
||||
- name: Assign interfaces to VRF (intent fail)
|
||||
nxos_vrf:
|
||||
name: test1
|
||||
associated_interfaces:
|
||||
- test
|
||||
provider: "{{ connection }}"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == True"
|
||||
|
||||
- name: Remove interface from vrf
|
||||
nxos_vrf: &single_int
|
||||
name: test1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue