community.vmware.vmware_host_snmp – Configures SNMP on an ESXi host system¶
Note
This plugin is part of the community.vmware collection (version 1.9.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_host_snmp
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
Parameters¶
Notes¶
Note
Tested on vSphere 6.5
You need to reset the agent (to factory defaults) if you want to clear all community strings, trap targets, or filters
SNMP v3 configuration isn’t implemented yet
Examples¶
- name: Enable and configure SNMP community
community.vmware.vmware_host_snmp:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
password: '{{ esxi_password }}'
community: [ test ]
state: enabled
delegate_to: localhost
- name: Configure SNMP traps and filters
community.vmware.vmware_host_snmp:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
password: '{{ esxi_password }}'
community: [ test ]
trap_targets:
- hostname: 192.168.1.100
port: 162
community: test123
- hostname: 192.168.1.101
port: 162
community: test1234
trap_filter:
- 1.3.6.1.4.1.6876.4.1.1.0
- 1.3.6.1.4.1.6876.4.1.1.1
state: enabled
delegate_to: localhost
- name: Disable SNMP
community.vmware.vmware_host_snmp:
hostname: '{{ esxi_hostname }}'
username: '{{ esxi_username }}'
password: '{{ esxi_password }}'
state: disabled
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Christian Kotte (@ckotte)