2017-11-13 08:03:06 +00:00
|
|
|
---
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_snmp_location sanity test"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-11-13 08:03:06 +00:00
|
|
|
|
|
|
|
- name: Setup - Remove snmp_location if configured
|
|
|
|
nxos_snmp_location: &remove
|
2018-04-27 07:37:21 +00:00
|
|
|
location: Test
|
2017-11-13 08:03:06 +00:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- block:
|
2018-04-27 07:37:21 +00:00
|
|
|
- name: Configure snmp location
|
2017-11-13 08:03:06 +00:00
|
|
|
nxos_snmp_location: &config
|
2018-04-27 07:37:21 +00:00
|
|
|
location: Testing
|
2017-11-13 08:03:06 +00:00
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &true
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: Idempotence Check
|
|
|
|
nxos_snmp_location: *config
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: &false
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-04-27 07:37:21 +00:00
|
|
|
- name: Change snmp location
|
|
|
|
nxos_snmp_location: &config1
|
|
|
|
location: Test
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence Check
|
|
|
|
nxos_snmp_location: *config1
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: remove snmp location
|
2017-11-13 08:03:06 +00:00
|
|
|
nxos_snmp_location: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
2018-04-27 07:37:21 +00:00
|
|
|
- name: Remove Idempotence
|
2017-11-13 08:03:06 +00:00
|
|
|
nxos_snmp_location: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-04-27 07:37:21 +00:00
|
|
|
always:
|
|
|
|
- name: Cleanup
|
|
|
|
nxos_snmp_location: *remove
|
|
|
|
register: result
|
|
|
|
|
2018-01-05 17:39:04 +00:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_snmp_location sanity test"
|