100 lines
2.2 KiB
YAML
100 lines
2.2 KiB
YAML
|
---
|
||
|
- debug: msg="START TRANSPORT:CLI nxos_ip_interface sanity test"
|
||
|
|
||
|
- set_fact: testint1="{{ nxos_int1 }}"
|
||
|
- set_fact: testint2="{{ nxos_int2 }}"
|
||
|
|
||
|
- name: "Put interface {{testint1}} into default state"
|
||
|
nxos_config: &intdefault1
|
||
|
lines:
|
||
|
- "default interface {{ testint1 }}"
|
||
|
provider: "{{ cli }}"
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: "Put interface {{testint2}} into default state"
|
||
|
nxos_config: &intdefault2
|
||
|
lines:
|
||
|
- "default interface {{ testint2 }}"
|
||
|
provider: "{{ cli }}"
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: "Make {{testint1}} a layer3 interface"
|
||
|
nxos_interface: &l3int1
|
||
|
interface: "{{ testint1 }}"
|
||
|
mode: layer3
|
||
|
description: 'Configured by Ansible - Layer3'
|
||
|
admin_state: 'up'
|
||
|
state: present
|
||
|
provider: "{{ cli }}"
|
||
|
|
||
|
- name: "Make {{testint2}} a layer3 interface"
|
||
|
nxos_interface: &l3int2
|
||
|
interface: "{{ testint2 }}"
|
||
|
mode: layer3
|
||
|
description: 'Configured by Ansible - Layer3'
|
||
|
admin_state: 'up'
|
||
|
state: present
|
||
|
provider: "{{ cli }}"
|
||
|
|
||
|
# For titanium
|
||
|
- name: Clear interface v4
|
||
|
nxos_ip_interface:
|
||
|
interface: "{{ testint1 }}"
|
||
|
version: v4
|
||
|
state: absent
|
||
|
addr: 20.20.20.20
|
||
|
mask: 24
|
||
|
provider: "{{ cli }}"
|
||
|
|
||
|
# For titanium
|
||
|
- name: Clear interface v6
|
||
|
nxos_ip_interface:
|
||
|
interface: "{{ testint2 }}"
|
||
|
version: v6
|
||
|
state: absent
|
||
|
addr: 'fd56:31f7:e4ad:5585::1'
|
||
|
mask: 64
|
||
|
provider: "{{ cli }}"
|
||
|
|
||
|
- name: Ensure ipv4 address is configured
|
||
|
nxos_ip_interface: &ipv4
|
||
|
interface: "{{ testint1 }}"
|
||
|
version: v4
|
||
|
state: present
|
||
|
addr: 20.20.20.20
|
||
|
mask: 24
|
||
|
provider: "{{ cli }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: &true
|
||
|
that:
|
||
|
- "result.changed == true"
|
||
|
|
||
|
- name: "Check Idempotence"
|
||
|
nxos_ip_interface: *ipv4
|
||
|
register: result
|
||
|
|
||
|
- assert: &false
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
|
||
|
- name: Ensure ipv6 address is configured
|
||
|
nxos_ip_interface: &ipv6
|
||
|
interface: "{{ testint2 }}"
|
||
|
version: v6
|
||
|
state: present
|
||
|
addr: 'fd56:31f7:e4ad:5585::1'
|
||
|
mask: 64
|
||
|
provider: "{{ cli }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: "Check Idempotence"
|
||
|
nxos_ip_interface: *ipv6
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
- debug: msg="END TRANSPORT:CLI nxos_ip_interface sanity test"
|