mirror of https://github.com/ansible/ansible.git
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 failurepull/36706/head
parent
215c80f9dc
commit
5a6b893240
@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
- debug: msg="START cli/intent.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
|
- name: setup - remove vlan used in test
|
||||||
|
vyos_config: &delete
|
||||||
|
lines:
|
||||||
|
- delete interfaces ethernet eth1 vif 100
|
||||||
|
- delete interfaces ethernet eth0 vif 100
|
||||||
|
|
||||||
|
- name: set vlan with name
|
||||||
|
vyos_vlan:
|
||||||
|
vlan_id: 100
|
||||||
|
name: vlan-100
|
||||||
|
interfaces: eth1
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.changed == true"
|
||||||
|
- "'set interfaces ethernet eth1 vif 100 description vlan-100' in result.commands"
|
||||||
|
|
||||||
|
- name: check vlan interface intent
|
||||||
|
vyos_vlan:
|
||||||
|
vlan_id: 100
|
||||||
|
name: vlan-100
|
||||||
|
associated_interfaces: eth1
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.failed == false"
|
||||||
|
|
||||||
|
- name: vlan interface config + intent
|
||||||
|
vyos_vlan:
|
||||||
|
vlan_id: 100
|
||||||
|
interfaces: eth0
|
||||||
|
associated_interfaces:
|
||||||
|
- eth0
|
||||||
|
- eth1
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.failed == false"
|
||||||
|
|
||||||
|
- name: vlan intent fail
|
||||||
|
vyos_vlan:
|
||||||
|
vlan_id: 100
|
||||||
|
associated_interfaces:
|
||||||
|
- eth3
|
||||||
|
- eth4
|
||||||
|
register: result
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.failed == True"
|
||||||
|
|
||||||
|
- debug: msg="End cli/intent.yaml on connection={{ ansible_connection }}"
|
Loading…
Reference in New Issue