VMware Cloud Community
AbhiShrivastava
Contributor
Contributor

VMware module for ansible

Hi team,

I saw some vmware module on ansible website. Each module requires username, password and hostname. why it is so ?

Why each module need these details ? below are some module.

- name: Rename a virtual machine (requires the virtual machine's uuid)

  vmware_guest:

   hostname: "{{ vcenter_hostname }}"

   username: "{{ vcenter_username }}"

   password: "{{ vcenter_password }}"

   validate_certs: no

   uuid: "{{ vm_uuid }}"

   name: new_name

   state: present

  delegate_to: localhost

- name: Remove a virtual machine by uuid

  vmware_guest:

   hostname: "{{ vcenter_hostname }}"

   username: "{{ vcenter_username }}"

   password: "{{ vcenter_password }}"

   validate_certs: no

   uuid: "{{ vm_uuid }}"

   state: absent

  delegate_to: localhost

- name: Manipulate vApp properties

  vmware_guest:

   hostname: "{{ vcenter_hostname }}"

   username: "{{ vcenter_username }}"

   password: "{{ vcenter_password }}"

   validate_certs: no

Regards

Abhinav

0 Kudos
1 Reply
ToniAll
Contributor
Contributor

That playbook is for vCenter.

It's not for local VMs.

The hostname: "{{ vcenter_hostname }}", username: "{{ vcenter_username }}", password: "{{ vcenter_password }}" you need for connection to vCenter.

0 Kudos