351f60b0e1
* nxos_hsrp_interfaces: new module * lint 1 * lint 2 * add normalize_interfaces * change version /2.9/2.10/ * /2.10/"2.10"/
57 lines
1.3 KiB
YAML
57 lines
1.3 KiB
YAML
---
|
|
- debug:
|
|
msg: "Start nxos_hsrp_interfaces replaced integration tests connection={{ ansible_connection }}"
|
|
|
|
- set_fact: test_int1="{{ nxos_int1 }}"
|
|
- set_fact: test_int2="{{ nxos_int2 }}"
|
|
- set_fact:
|
|
bfd_enable: enable
|
|
bfd_disable: disable
|
|
when: platform is not search('N35')
|
|
|
|
- block:
|
|
- name: setup1
|
|
cli_config: &setup_teardown
|
|
config: |
|
|
no feature bfd
|
|
no feature hsrp
|
|
default interface {{ test_int1 }}
|
|
default interface {{ test_int2 }}
|
|
|
|
- name: setup2
|
|
cli_config:
|
|
config: |
|
|
feature bfd
|
|
feature hsrp
|
|
interface {{ test_int1 }}
|
|
no switchport
|
|
hsrp bfd
|
|
interface {{ test_int2 }}
|
|
no switchport
|
|
|
|
- name: Replaced
|
|
nxos_hsrp_interfaces: &replaced
|
|
config:
|
|
- name: "{{ test_int1 }}"
|
|
bfd: "{{ bfd_disable|default(omit)}}"
|
|
state: replaced
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'no hsrp bfd' in result.commands"
|
|
msg: "Assert failed. 'result.commands': {{ result.commands }}"
|
|
|
|
- name: Idempotence - Replaced
|
|
nxos_hsrp_interfaces: *replaced
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
- "result.commands|length == 0"
|
|
|
|
always:
|
|
- name: teardown
|
|
cli_config: *setup_teardown
|