Ansible does not have a built-in module specifically designed to manage
vCenter alarms for ESXi hosts. However, you can use the
vmware_vm_vm_drs_rule module to work with DRS rules which are closely
related to alarms.
---
- name: Disable vCenter alarm for ESXi host
hosts: localhost
gather_facts: no
tasks:
- name: Create DRS Rule to disable alarm
community.vmware.vm_vm_drs_rule:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
cluster_name: "{{ cluster_name }}"
enabled: no # Set to yes to enable the rule, no to disable
affinity_rule: False # Set to True if you're working with affinity
rules
drs_rule_name: "Disable Alarm Rule"
affinity_rule_name: "Affinity Rule"
enabled_rule_name: "Enabled Rule"
disabled_rule_name: "Disabled Rule"
state: "present"
On Tuesday, June 27, 2023 at 11:12:56 AM UTC-7 Tony Wong wrote:
> any idea how to disable/enable vcenter alarm for esxi host in ansible task?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0753b577-a206-4dea-968b-d8969add6247n%40googlegroups.com.