mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
c371ed8d30
* Fix over-byte * Fix nxos_l2_interface docs * Update connections for tasks * Add default ssh port * Only report provider when using connection=local * Send empty provider when connection=network_cli * Fix find tasks
63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_vrf_interface sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
# Select interface for test
|
|
- set_fact: intname="{{ nxos_int1 }}"
|
|
|
|
- block:
|
|
- name: put interface in L3
|
|
nxos_config:
|
|
commands:
|
|
- no switchport
|
|
parents:
|
|
- "interface {{ intname }}"
|
|
match: none
|
|
provider: "{{ connection }}"
|
|
|
|
- name: Ensure vrf ntc exists on interface
|
|
nxos_vrf_interface: &configure
|
|
vrf: ntc
|
|
interface: "{{ intname }}"
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: &true
|
|
that:
|
|
- "result.changed == true"
|
|
|
|
- name: "Conf Idempotence"
|
|
nxos_vrf_interface: *configure
|
|
register: result
|
|
|
|
- assert: &false
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: Ensure ntc VRF does not exist on interface
|
|
nxos_vrf_interface: &remove
|
|
vrf: ntc
|
|
interface: "{{ intname }}"
|
|
state: absent
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: "Remove Idempotence"
|
|
nxos_vrf_interface: *remove
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: put interface in default mode
|
|
nxos_config:
|
|
lines: "default interface {{ intname }}"
|
|
provider: "{{ connection }}"
|
|
match: none
|
|
ignore_errors: yes
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_vrf_interface sanity test"
|