New in version 1.9.
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| authkey |
no |
Authentication key, required if version is v3
|
||
| community |
no |
The SNMP community string, required if version is v2/v2c
|
||
| host |
yes |
Set to target snmp server (normally {{inventory_hostname}})
|
||
| integrity |
no |
|
Hashing algorithm, required if version is v3
|
|
| level |
no |
|
Authentication level, required if version is v3
|
|
| privacy |
no |
|
Encryption algorithm, required if level is authPriv
|
|
| privkey |
no |
Encryption key, required if version is authPriv
|
||
| username |
no |
Username for SNMPv3, required if version is v3
|
||
| version |
yes |
|
SNMP Version to use, v2/v2c or v3
|
# Gather facts with SNMP version 2 - snmp_facts: host: '{{ inventory_hostname }}' version: v2c community: public delegate_to: local # Gather facts using SNMP version 3 - snmp_facts: host: '{{ inventory_hostname }}' version: v3 level: authPriv integrity: sha privacy: aes username: snmp-user authkey: abc12345 privkey: def6789 delegate_to: localhost
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.