ansible/test/integration/targets/nxos_ip_interface/tests/nxapi/sanity.yaml
Nathaniel Case e9d7fa0418
HTTP(S) API connection plugin (#39224)
* HTTPAPI connection

* Punt run_commands to cliconf or httpapi

* Fake enable_mode on eapi

* Pull changes to nxos

* Move load_config to edit_config for future-preparedness

* Don't fail on lldp disabled

* Re-enable check_rc on nxos' run_commands

* Reorganize nxos httpapi plugin for compatibility

* draft docs for connection: httpapi

* restores docs for connection:local for eapi

* Add _remote_is_local to httpapi
2018-05-17 18:47:15 -04:00

93 lines
2.1 KiB
YAML

---
- debug: msg="START TRANSPORT:NXAPI nxos_ip_interface sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: testint1="{{ nxos_int1 }}"
- set_fact: testint2="{{ nxos_int2 }}"
- name: "Put interface {{testint1}} into default state"
nxos_config: &intdefault1
lines:
- "default interface {{ testint1 }}"
ignore_errors: yes
- name: "Put interface {{testint2}} into default state"
nxos_config: &intdefault2
lines:
- "default interface {{ testint2 }}"
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
- name: "Make {{testint2}} a layer3 interface"
nxos_interface: &l3int2
interface: "{{ testint2 }}"
mode: layer3
description: 'Configured by Ansible - Layer3'
admin_state: 'up'
state: present
# For titanium
- name: Clear interface v4
nxos_ip_interface:
interface: "{{ testint1 }}"
version: v4
state: absent
addr: 20.20.20.20
mask: 24
# For titanium
- name: Clear interface v6
nxos_ip_interface:
interface: "{{ testint2 }}"
version: v6
state: absent
addr: 'fd56:31f7:e4ad:5585::1'
mask: 64
- name: Ensure ipv4 address is configured
nxos_ip_interface: &ipv4
interface: "{{ testint1 }}"
version: v4
state: present
addr: 20.20.20.20
mask: 24
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
register: result
- assert: *true
- name: "Check Idempotence"
nxos_ip_interface: *ipv6
register: result
- assert: *false
- debug: msg="END TRANSPORT:NXAPI nxos_ip_interface sanity test"