zaki_lknr.esxissh.esxissh_guest_power (1.1.0) — module

Manages power states of VM in ESXi with enable SSH

Authors: zaki (@zaki-lknr)

Install collection

Install with ansible-galaxy collection install zaki_lknr.esxissh:==1.1.0


Add to requirements.yml

  collections:
    - name: zaki_lknr.esxissh
      version: 1.1.0

Description

Power on / off / shutdown (require vmware-tools) a virtual machine.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set the state of a VM to poweron
  esxissh_guest_power:
    esxiaddress: '{{ esxi_hostaddr }}'
    esxiusername: '{{ esxi_sshuser }}'
    esxipassword: '{{ esxi_sshpass }}'
    vmname: mv-virtual-machine
    state: poweron
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set the state of a VM to shutdown (require vmware-tools)
  esxissh_guest_power:
    esxiaddress: '{{ esxi_hostaddr }}'
    esxiusername: '{{ esxi_sshuser }}'
    esxipassword: '{{ esxi_sshpass }}'
    vmname: mv-virtual-machine
    state: shutdown
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set the state of a VM to poweroff
  esxissh_guest_power:
    esxiaddress: '{{ esxi_hostaddr }}'
    esxiusername: '{{ esxi_sshuser }}'
    esxipassword: '{{ esxi_sshpass }}'
    vmname: mv-virtual-machine
    state: poweroff

Inputs

    
state:
    default: poweron
    description:
    - Set the state of the virtual machine.
    type: str

vmname:
    description:
    - name of the virtual machine to work with.
    type: str

esxiaddress:
    description:
    - The hostname or IP address of SSH on ESXi server
    type: str

esxipassword:
    description:
    - The password of SSH on ESXi server
    type: str

esxiusername:
    description:
    - The username of SSH on ESXi server
    type: str