ansible/test/integration/targets/eos_l3_interfaces/tests/common/merged.yaml
Nathaniel Case e266e5f8b6
Allow httpapi for resource modules (#62843)
* Redo tests to be transport agnostic

cli -> eos config

Redirect connection for httpapi
2020-01-14 14:26:10 -05:00

55 lines
1.2 KiB
YAML

---
- include_tasks: reset_config.yml
- set_fact:
config:
- name: Ethernet1
ipv4:
- address: 198.51.100.14/24
- name: Ethernet2
ipv4:
- address: 203.0.113.227/31
- eos_facts:
gather_network_resources: l3_interfaces
become: yes
- name: Merge provided configuration with device configuration.
eos_l3_interfaces:
config: "{{ config }}"
state: merged
register: result
become: yes
- assert:
that:
- "ansible_facts.network_resources.l3_interfaces|symmetric_difference(result.before) == []"
- eos_facts:
gather_network_resources: l3_interfaces
become: yes
- assert:
that:
- "ansible_facts.network_resources.l3_interfaces|symmetric_difference(result.after) == []"
become: yes
- set_fact:
expected_config:
- name: Ethernet1
ipv4:
- address: 198.51.100.14/24
- address: 203.0.113.27/31
secondary: true
- name: Ethernet2
ipv4:
- address: 203.0.113.227/31
ipv6:
- address: 2001:db8::1/64
- name: Management1
ipv4:
- address: dhcp
- assert:
that:
- "ansible_facts.network_resources.l3_interfaces|symmetric_difference(expected_config) == []"