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:
Ganesh Nalawade 2018-02-26 09:23:54 +05:30 committed by GitHub
commit 5a6b893240
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 457 additions and 100 deletions

View file

@ -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