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:
@@ -118,13 +118,16 @@
|
||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
||||
- "'ansible_1' in result.session_name"
|
||||
|
||||
- name: Add interfaces to vlan
|
||||
- name: Add interfaces to vlan and check state
|
||||
eos_vlan:
|
||||
vlan_id: 4000
|
||||
state: present
|
||||
interfaces:
|
||||
- Ethernet1
|
||||
- Ethernet2
|
||||
associated_interfaces:
|
||||
- Ethernet1
|
||||
- Ethernet2
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
@@ -160,6 +163,22 @@
|
||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
||||
- "result.session_name is not defined"
|
||||
|
||||
- name: vlan interface intent fail
|
||||
eos_vlan:
|
||||
vlan_id: 4000
|
||||
state: present
|
||||
associated_interfaces:
|
||||
- test
|
||||
authorize: yes
|
||||
provider: "{{ cli }}"
|
||||
become: yes
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == True"
|
||||
|
||||
- name: Remove interface from vlan
|
||||
eos_vlan:
|
||||
vlan_id: 4000
|
||||
|
||||
Reference in New Issue
Block a user