69564206e0
* Handle nxos_feature issue where json isn't supported (#39150) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit9eff1f1d74
) * Integration Tests only: nxos_snmp_contact (#39318) * add integration test cases for snmp_contact * removing unnecessary files (cherry picked from commitbdb75cd82c
) * fix nxos_ntp issues (#39178) * fix nxos_ntp issues * review comments * fix idempotent fail case (cherry picked from commit2f99a17856
) * nxos_interface: AttributeError: 'NoneType' object has no attribute 'group' (#38544) This fixes an issue we recently encounteredi with nxos_interface: ``` Traceback (most recent call last): File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 777, in main have = map_config_to_obj(want, module) File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 606, in map_config_to_obj obj['speed'] = re.search(r'speed (\d+)', body).group(1) AttributeError: 'NoneType' object has no attribute 'group' ``` (cherry picked from commitdca6e2d94d
) * fix nxos_snmp_community issues (#39258) (cherry picked from commit1afec5a48e
) * Add aggregate example in nxos_l2_interface module doc (#39275) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit86817cdd52
) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … (#39074) * Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config * Fix all instances of self.config(self,... (cherry picked from commit80d7e22f5e
) * Fix for nxos_snmp_host issues (#39642) * fix snmp_host issues * source files * fix shippable * remove defaults to match arg spec (cherry picked from commitf99bae1776
) * fix nxos_snmp_traps issues (#39444) * fix snmp_traps code * add IT cases * fix shippable * fix shippable without ignore (cherry picked from commit99748cbfa4
) * changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
147 lines
3 KiB
YAML
147 lines
3 KiB
YAML
---
|
|
- debug: msg="START connection={{ ansible_connection }} nxos_snmp_community sanity test"
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
when: ansible_connection == "local"
|
|
|
|
- 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
|
|
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: Change snmp_community group
|
|
nxos_snmp_community: &chg
|
|
community: TESTING7
|
|
group: network-admin
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Idempotence Check
|
|
nxos_snmp_community: *chg
|
|
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-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
|
|
|
|
- name: Change acl
|
|
nxos_snmp_community: &chgacl
|
|
community: TESTING7
|
|
access: rw
|
|
acl: new_acl
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Idempotence Check
|
|
nxos_snmp_community: *chgacl
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
- name: Remove acl
|
|
nxos_snmp_community: &removeacl
|
|
community: TESTING7
|
|
access: rw
|
|
acl: default
|
|
state: present
|
|
provider: "{{ connection }}"
|
|
register: result
|
|
|
|
- assert: *true
|
|
|
|
- name: Idempotence Check
|
|
nxos_snmp_community: *removeacl
|
|
register: result
|
|
|
|
- assert: *false
|
|
|
|
always:
|
|
- name: Cleanup
|
|
nxos_snmp_community: *remove
|
|
|
|
- debug: msg="END connection={{ ansible_connection }} nxos_snmp_community sanity test"
|