forked from ansible-collections/community.vmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added work through vCenter Server for ansible-collections#1799 (ansib…
…le-collections#1832) added work through vCenter Server for ansible-collections#1799 SUMMARY Fixes ansible-collections#1799 ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_host_snmp Reviewed-by: Mario Lenz <[email protected]>
- Loading branch information
Showing
5 changed files
with
504 additions
and
284 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/1799_configure_snmp_on_esxii_hosts_via_vcenter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- community.vmware.vmware_host_snmp module now can configure SNMP agent on set of hosts (list in esxi_hostname parameter or as cluster in cluster_name parameter). The ability to configure the host directly remains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,24 @@ Parameters | |
<th>Choices/<font color="blue">Defaults</font></th> | ||
<th width="100%">Comments</th> | ||
</tr> | ||
<tr> | ||
<td colspan="1"> | ||
<div class="ansibleOptionAnchor" id="parameter-"></div> | ||
<b>cluster_name</b> | ||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> | ||
<div style="font-size: small"> | ||
<span style="color: purple">string</span> | ||
</div> | ||
<div style="font-style: italic; font-size: small; color: darkgreen">added in 3.10.0</div> | ||
</td> | ||
<td> | ||
</td> | ||
<td> | ||
<div>Name of cluster.</div> | ||
<div>All host system from given cluster used to manage SNMP agent.</div> | ||
<div>Required parameter, if <code>esxi_hostname</code> is not set.</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="1"> | ||
<div class="ansibleOptionAnchor" id="parameter-"></div> | ||
|
@@ -49,6 +67,24 @@ Parameters | |
<div>List of SNMP community strings.</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="1"> | ||
<div class="ansibleOptionAnchor" id="parameter-"></div> | ||
<b>esxi_hostname</b> | ||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> | ||
<div style="font-size: small"> | ||
<span style="color: purple">list</span> | ||
/ <span style="color: purple">elements=string</span> | ||
</div> | ||
<div style="font-style: italic; font-size: small; color: darkgreen">added in 3.10.0</div> | ||
</td> | ||
<td> | ||
</td> | ||
<td> | ||
<div>List of ESXi hostname to manage SNMP agent.</div> | ||
<div>Required parameter, if <code>cluster_name</code> is not set.</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="1"> | ||
<div class="ansibleOptionAnchor" id="parameter-"></div> | ||
|
@@ -356,7 +392,7 @@ Examples | |
|
||
.. code-block:: yaml | ||
- name: Enable and configure SNMP community | ||
- name: Enable and configure SNMP community on standalone ESXi host | ||
community.vmware.vmware_host_snmp: | ||
hostname: '{{ esxi_hostname }}' | ||
username: '{{ esxi_username }}' | ||
|
@@ -365,11 +401,12 @@ Examples | |
state: enabled | ||
delegate_to: localhost | ||
- name: Configure SNMP traps and filters | ||
- name: Configure SNMP traps and filters on cluster | ||
community.vmware.vmware_host_snmp: | ||
hostname: '{{ esxi_hostname }}' | ||
username: '{{ esxi_username }}' | ||
password: '{{ esxi_password }}' | ||
hostname: '{{ vcenter_hostname }}' | ||
username: '{{ vcenter_username }}' | ||
password: '{{ vcenter_password }}' | ||
cluster_name: '{{ cluster_name }}' | ||
community: [ test ] | ||
trap_targets: | ||
- hostname: 192.168.1.100 | ||
|
@@ -384,17 +421,18 @@ Examples | |
state: enabled | ||
delegate_to: localhost | ||
- name: Enable and configure SNMP system contact and location | ||
- name: Enable and configure SNMP system contact and location on simple ESXi host in vCenter | ||
community.vmware.vmware_host_snmp: | ||
hostname: '{{ esxi_hostname }}' | ||
username: '{{ esxi_username }}' | ||
password: '{{ esxi_password }}' | ||
hostname: '{{ vcenter_hostname }}' | ||
username: '{{ vcenter_username }}' | ||
password: '{{ vcenter_password }}' | ||
esxi_hostname: '{{ esxi_hostname }}' | ||
sys_contact: "[email protected]" | ||
sys_location: "Austin, USA" | ||
state: enabled | ||
delegate_to: localhost | ||
- name: Disable SNMP | ||
- name: Disable SNMP on standalone ESXi host | ||
community.vmware.vmware_host_snmp: | ||
hostname: '{{ esxi_hostname }}' | ||
username: '{{ esxi_username }}' | ||
|
@@ -430,7 +468,7 @@ Common return values are documented `here <https://docs.ansible.com/ansible/late | |
<div>metadata about host system's SNMP configuration</div> | ||
<br/> | ||
<div style="font-size: smaller"><b>Sample:</b></div> | ||
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{'esxi01': {'changed': False, 'community': ['test'], 'hw_source': 'indications', 'msg': 'SNMP already configured properly', 'port': 161, 'state': 'enabled', 'trap_targets': []}}</div> | ||
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">{'changed': True, 'esx01.example.local': {'changed': True, 'community': ['test'], 'community_previous': [], 'hw_source': 'indications', 'log_level': 'info', 'log_level_previous': 'warning', 'msg': 'SNMP state, community list, log level, sys contact, and sys location changed', 'port': 161, 'state': 'enabled', 'state_previous': 'disabled', 'sys_contact_previous': '', 'sys_location_previous': '', 'trap_filter': None, 'trap_targets': []}, 'failed': False}</div> | ||
</td> | ||
</tr> | ||
</table> | ||
|
@@ -445,3 +483,4 @@ Authors | |
~~~~~~~ | ||
|
||
- Christian Kotte (@ckotte) | ||
- Alexander Nikitin (@ihumster) |
Oops, something went wrong.