community.vmware.vmware_guest_register_operation – VM inventory registration operation¶
Note
This plugin is part of the community.vmware collection (version 1.7.0).
To install it use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_guest_register_operation
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
PyVmomi
Parameters¶
Examples¶
- name: Register VM to inventory
community.vmware.vmware_guest_register_operation:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ datacenter }}"
folder: "/vm"
esxi_hostname: "{{ esxi_hostname }}"
name: "{{ vm_name }}"
template: false
path: "[datastore1] vm/vm.vmx"
state: present
- name: Register VM in resource pool
community.vmware.vmware_guest_register_operation:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ datacenter }}"
folder: "/vm"
resource_pool: "{{ resource_pool }}"
name: "{{ vm_name }}"
template: false
path: "[datastore1] vm/vm.vmx"
state: present
- name: Register VM in Cluster
community.vmware.vmware_guest_register_operation:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ datacenter }}"
folder: "/vm"
cluster: "{{ cluster_name }}"
name: "{{ vm_name }}"
template: false
path: "[datastore1] vm/vm.vmx"
state: present
- name: UnRegister VM from inventory
community.vmware.vmware_guest_register_operation:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ datacenter }}"
folder: "/vm"
name: "{{ vm_name }}"
state: absent
Authors¶
sky-joker (@sky-joker)