mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.0 KiB
YAML
97 lines
2.0 KiB
YAML
7 years ago
|
---
|
||
|
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_snmp_community sanity test"
|
||
|
|
||
|
- name: Setup - Remove snmp_community if configured
|
||
|
nxos_snmp_community: &remove
|
||
|
community: TESTING7
|
||
|
group: network-operator
|
||
|
state: absent
|
||
|
provider: "{{ connection }}"
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- block:
|
||
|
|
||
|
- name: Configure snmp_community group
|
||
|
nxos_snmp_community: &config
|
||
|
community: TESTING7
|
||
|
group: network-operator
|
||
|
#access: ro
|
||
|
state: present
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: &true
|
||
|
that:
|
||
|
- "result.changed == true"
|
||
|
|
||
|
- name: Idempotence Check
|
||
|
nxos_snmp_community: *config
|
||
|
register: result
|
||
|
|
||
|
- assert: &false
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
|
||
|
- name: Remove snmp_community
|
||
|
nxos_snmp_community: *remove
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: Idempotence Check
|
||
|
nxos_snmp_community: *remove
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
- name: Configure snmp_community access read-only
|
||
|
nxos_snmp_community: &configaccess
|
||
|
community: TESTING7
|
||
|
access: ro
|
||
|
state: present
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: Idempotence Check
|
||
|
nxos_snmp_community: *configaccess
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
- name: Remove snmp_community
|
||
|
nxos_snmp_community: *remove
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: Idempotence Check
|
||
|
nxos_snmp_community: *remove
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
- name: Configure snmp_community access read-write
|
||
|
nxos_snmp_community: &configaccessrw
|
||
|
community: TESTING7
|
||
|
access: rw
|
||
|
acl: ansible_acl
|
||
|
state: present
|
||
|
provider: "{{ connection }}"
|
||
|
register: result
|
||
|
|
||
|
- assert: *true
|
||
|
|
||
|
- name: Idempotence Check
|
||
|
nxos_snmp_community: *configaccessrw
|
||
|
register: result
|
||
|
|
||
|
- assert: *false
|
||
|
|
||
|
always:
|
||
|
- name: Cleanup
|
||
|
nxos_snmp_community: *remove
|
||
|
|
||
|
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_snmp_community sanity test"
|