f0ef624cff
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start nxos_l3_interfaces merged integration tests connection={{ ansible_connection }}"
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
|
|
- name: setup1
|
|
cli_config: &cleanup
|
|
config: |
|
|
default interface {{ test_int1 }}
|
|
|
|
- block:
|
|
- name: setup2
|
|
cli_config:
|
|
config: |
|
|
interface {{ test_int1 }}
|
|
no switchport
|
|
|
|
- name: Merged
|
|
nxos_l3_interfaces: &merged
|
|
config:
|
|
- name: "{{ test_int1 }}"
|
|
ipv4:
|
|
- address: 192.168.10.2/24
|
|
state: merged
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "result.before|length == 0"
|
|
- "'interface {{ test_int1 }}' in result.commands"
|
|
- "'ip address 192.168.10.2/24' in result.commands"
|
|
- "result.commands|length == 2"
|
|
|
|
- name: Gather l3_interfaces facts
|
|
nxos_facts:
|
|
gather_subset:
|
|
- '!all'
|
|
- '!min'
|
|
gather_network_resources: l3_interfaces
|
|
|
|
- assert:
|
|
that:
|
|
- "ansible_facts.network_resources.l3_interfaces|symmetric_difference(result.after)|length == 0"
|
|
|
|
- name: Idempotence - Merged
|
|
nxos_l3_interfaces: *merged
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
- "result.commands|length == 0"
|
|
|
|
always:
|
|
- name: teardown
|
|
cli_config: *cleanup
|