Hello All,
I’m using Ansible 2.3 RC2.
According to the sample comments in the code (https://github.com/ansible/ansible-modules-extras/blob/devel/cloud/vmware/vmware_guest.py), this is all I need to get a VM facts:
Gather facts only
- name: gather the VM facts
vmware_guest:
validate_certs: False
hostname: 192.168.1.209
username: administrator@vsphere.local
password: vmware
name: testvm_2
esxi_hostname: 192.168.1.117
register: facts
But when I run my playbook:
- name: Gather Facts about the VMs
hosts: modify
gather_facts: False
connection: local
vars_files:- group_vars/vault/lab_credentials.yml
tasks:- name: gather the VM facts
vmware_guest:
validate_certs: False
hostname: “{{ vcenter_hostname }}”
username: “{{ vcenter_user }}”
password: “{{ vcenter_passwd }}”
name: “{{ guest_name }}”
esxi_hostname: “{{ guest_esxhost }}”
register: facts
It asks me for the datacenter name:
“No datacenter named ha-datacenter was found”
I give it the datacenter name in the playbook, but it complaints about datastore name not specified:
“Failed to find a matching datastore”
Following down down this path I realize that Ansible is trying to create a VM. Why? What am I missing? It is exactly the same code from the samples…