nxos_snmp_user, nxos_snmp_host integration test fixes. (#57201)

* Fix nxos_snmp tests

* Add imagetag check for nxos_snmp_user test
This commit is contained in:
Mike Wiebe 2019-06-03 09:03:52 -04:00 committed by Trishna Guha
parent 2e0229a4b6
commit 87422ea7e7
2 changed files with 8 additions and 2 deletions

View file

@ -1,7 +1,7 @@
--- ---
- set_fact: snmp_type="inform" - set_fact: snmp_type="inform"
- set_fact: snmp_version="v3" - set_fact: snmp_version="v3"
- set_fact: snmp_auth="noauth" - set_fact: snmp_auth="priv"
- debug: msg="START connection={{ ansible_connection }} nxos_snmp_host {{ snmp_type }} {{ snmp_version }} sanity test" - debug: msg="START connection={{ ansible_connection }} nxos_snmp_host {{ snmp_type }} {{ snmp_version }} sanity test"
- debug: msg="Using provider={{ connection.transport }}" - debug: msg="Using provider={{ connection.transport }}"

View file

@ -3,6 +3,12 @@
- debug: msg="Using provider={{ connection.transport }}" - debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local" when: ansible_connection == "local"
- set_fact: delete_last_user_allowed='true'
- set_fact: delete_last_user_allowed='false'
when: imagetag and (imagetag is version_compare('9.1', 'ge'))
- set_fact: delete_last_user_allowed='false'
when: platform is search('N5K|N6K|N9K-F')
- name: Remove snmp user - name: Remove snmp user
nxos_snmp_user: &remove_snmp_user nxos_snmp_user: &remove_snmp_user
user: ntc user: ntc
@ -95,7 +101,7 @@
register: result register: result
- assert: *false - assert: *false
when: platform is not search('N5K|N6K|N9K-F') when: delete_last_user_allowed
always: always:
- name: delete snmp user - name: delete snmp user