Hi Everyone,
I was working with snmp_facts v2 module to gather a variety of facts from the cisco Switches. Now we migrated from snmp v2 to v3 on all switches that we administer. Thus, i tried to adjust the playbook in which i can gather the snmp-facts with v3.
The Problem now that the Playbook get stuck when it reaches the snmp-facts task.
Note: i did a snmp-walk from the terminal with v3 Credentials, it works fine.
I am using Ubuntu:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION=“Ubuntu 22.04.5 LTS”
PRETTY_NAME=“Ubuntu 22.04.5 LTS”
NAME=“Ubuntu”
VERSION_ID=“22.04”
VERSION=“22.04.5 LTS (Jammy Jellyfish)”
Ansible Version:
ansible [core 2.17.14]
config file = /home/test/ansible.cfg
configured module search path = [‘/home/test/ntc-ansible’]
ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
ansible collection location = /home/test/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.10.12 (main, Nov 4 2025, 08:48:33) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.1.6
libyaml = True
The task in the Playbook:
- name: Gather facts with SNMP version 3
snmp_facts:
host: ‘{{ inventory_hostname }}’
version: v3
level: authPriv
integrity: sha
privacy: aes
username: xxxxxxxxxxxx
authkey: xxxxxxxxxxxxxx
privkey: xxxxxxxxxxxxxxx
timeout: 5
register: output1
tags: create