Manage services on a given ESXi host
- This module can be used to manage (start, stop, restart) services on a given ESXi host.
- If cluster_name is provided, specified service will be managed on all ESXi host belonging to that cluster.
- If specific esxi_hostname is provided, then specified service will be managed on given ESXi host only.
Note
- All modules requires API write access and hence is not supported on a free ESXi license.
- name: Start ntpd service setting for all ESXi Host in given Cluster
community.vmware.vmware_host_service_manager:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
cluster_name: '{{ cluster_name }}'
service_name: ntpd
state: present
delegate_to: localhost
- name: Start ntpd setting for an ESXi Host
community.vmware.vmware_host_service_manager:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: '{{ esxi_hostname }}'
service_name: ntpd
state: present
delegate_to: localhost
- name: Start ntpd setting for an ESXi Host with Service policy
community.vmware.vmware_host_service_manager:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: '{{ esxi_hostname }}'
service_name: ntpd
service_policy: 'on'
state: present
delegate_to: localhost
- name: Stop ntpd setting for an ESXi Host
community.vmware.vmware_host_service_manager:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: '{{ esxi_hostname }}'
service_name: ntpd
state: absent
delegate_to: localhost
- Abhijeet Kasurde (@Akasurde)