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

@ -72,6 +72,31 @@
that:
- "result.changed == false"
- name: Check interface assigned to vrf (intent)
ios_vlan:
vlan_id: 100
associated_interfaces:
- GigabitEthernet0/1
- GigabitEthernet0/2
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.failed == false"
- name: Check interface assigned to vrf (fail)
ios_vlan:
vlan_id: 100
associated_interfaces:
- test
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.failed == True"
- name: Remove interface from vlan
ios_vlan: &single_int
vlan_id: 100