2017-11-13 09:03:06 +01:00
|
|
|
---
|
2018-01-05 18:39:04 +01: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 09:03:06 +01:00
|
|
|
|
|
|
|
- name: Setup - Remove snmp_location if configured
|
|
|
|
nxos_snmp_location: &remove
|
2018-04-27 09:37:21 +02:00
|
|
|
location: Test
|
2017-11-13 09:03:06 +01:00
|
|
|
state: absent
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
- block:
|
2018-04-27 09:37:21 +02:00
|
|
|
- name: Configure snmp location
|
2017-11-13 09:03:06 +01:00
|
|
|
nxos_snmp_location: &config
|
2018-04-27 09:37:21 +02:00
|
|
|
location: Testing
|
2017-11-13 09:03:06 +01:00
|
|
|
state: present
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
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 09:37:21 +02:00
|
|
|
- name: Change snmp location
|
|
|
|
nxos_snmp_location: &config1
|
|
|
|
location: Test
|
|
|
|
state: present
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
|
|
|
- name: Idempotence Check
|
|
|
|
nxos_snmp_location: *config1
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
|
|
|
- name: remove snmp location
|
2017-11-13 09:03:06 +01:00
|
|
|
nxos_snmp_location: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *true
|
|
|
|
|
2018-04-27 09:37:21 +02:00
|
|
|
- name: Remove Idempotence
|
2017-11-13 09:03:06 +01:00
|
|
|
nxos_snmp_location: *remove
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert: *false
|
|
|
|
|
2018-04-27 09:37:21 +02:00
|
|
|
always:
|
|
|
|
- name: Cleanup
|
|
|
|
nxos_snmp_location: *remove
|
|
|
|
register: result
|
|
|
|
|
2018-01-05 18:39:04 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_snmp_location sanity test"
|