mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00: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:
@@ -85,7 +85,7 @@
|
||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
||||
- "result.session_name is not defined"
|
||||
|
||||
- name: Add Ethernet2 to vrf
|
||||
- name: Add Ethernet2 to vrf and check interface assigned state
|
||||
eos_vrf:
|
||||
name: test
|
||||
rd: 1:201
|
||||
@@ -93,6 +93,8 @@
|
||||
authorize: yes
|
||||
interfaces:
|
||||
- Ethernet2
|
||||
associated_interfaces:
|
||||
- Ethernet2
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
@@ -124,6 +126,22 @@
|
||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
||||
- "'session_name' not in result.commands"
|
||||
|
||||
- name: vrf interface intent fail
|
||||
eos_vrf:
|
||||
name: test
|
||||
state: present
|
||||
authorize: yes
|
||||
associated_interfaces:
|
||||
- test
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == True"
|
||||
|
||||
- name: Add multiple interfaces to vrf
|
||||
eos_vrf:
|
||||
name: test1
|
||||
|
||||
Reference in New Issue
Block a user