community.vmware.vmware_host_service_manager – Manage services on a given ESXi host¶
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_service_manager
.
Synopsis¶
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.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
Parameters¶
Examples¶
- 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
Authors¶
Abhijeet Kasurde (@Akasurde)