ansible / ansible.builtin / v2.7.9 / module / vmware_maintenancemode Place a host into maintenance mode | "added in version" 2.1 of ansible.builtin" Authors: Jay Jahns (@jjahns) <jjahns@vmware.com>, Abhijeet Kasurde (@Akasurde) preview | supported by communityansible.builtin.vmware_maintenancemode (v2.7.9) — module
pip
Install with pip install ansible==2.7.9
This module can be used for placing a ESXi host into maintenance mode.
Support for VSAN compliant maintenance mode when selected.
- name: Enter VSAN-Compliant Maintenance Mode vmware_maintenancemode: hostname: "{{ vcenter_hostname }}" username: "{{ vcenter_username }}" password: "{{ vcenter_password }}" esxi_hostname: "{{ esxi_hostname }}" vsan: ensureObjectAccessibility evacuate: yes timeout: 3600 state: present delegate_to: localhost
port: default: 443 description: - The port number of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_PORT) will be used instead. - Environment variable support added in Ansible 2.6. type: int vsan: aliases: - vsan_mode choices: - ensureObjectAccessibility - evacuateAllData - noAction description: - Specify which VSAN compliant mode to enter. required: false state: choices: - present - absent default: present description: - Enter or exit maintenance mode. required: false timeout: default: 0 description: - Specify a timeout for the operation. required: false evacuate: default: false description: - If set to C(True), evacuate all powered off VMs. required: false type: bool hostname: description: - The hostname or IP address of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_HOST) will be used instead. - Environment variable support added in Ansible 2.6. type: str password: aliases: - pass - pwd description: - The password of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_PASSWORD) will be used instead. - Environment variable support added in Ansible 2.6. type: str username: aliases: - admin - user description: - The username of the vSphere vCenter or ESXi server. - If the value is not specified in the task, the value of environment variable C(VMWARE_USER) will be used instead. - Environment variable support added in Ansible 2.6. type: str proxy_host: description: - Address of a proxy that will receive all HTTPS requests and relay them. - The format is a hostname or a IP. - If the value is not specified in the task, the value of environment variable C(VMWARE_PROXY_HOST) will be used instead. - This feature depends on a version of pyvmomi greater than v6.7.1.2018.12 required: false type: str proxy_port: description: - Port of the HTTP proxy that will receive all HTTPS requests and relay them. - If the value is not specified in the task, the value of environment variable C(VMWARE_PROXY_PORT) will be used instead. required: false type: int esxi_hostname: description: - Name of the host as defined in vCenter. required: true validate_certs: default: true description: - Allows connection when SSL certificates are not valid. Set to C(false) when certificates are not trusted. - If the value is not specified in the task, the value of environment variable C(VMWARE_VALIDATE_CERTS) will be used instead. - Environment variable support added in Ansible 2.6. - If set to C(true), please make sure Python >= 2.7.9 is installed on the given machine. type: bool
hostname: description: Name of host in vCenter returned: always sample: esxi.local.domain type: string hostsystem: description: Name of vim reference returned: always sample: '''vim.HostSystem:host-236''' type: string status: description: Action taken returned: always sample: ENTER type: string