ANSIBLE VERSION USED: 2.2.0
I am trying to deploy a virtual machine from a template that is already present on an ESX which is managed by a VCenter Server.
I’m getting the following error after the execution of my playbook:
“Cannot connect to x.x.x.x: [InvalidLoginFault]: Cannot complete login due to an incorrect user name or password.”
Playbook is as follows:
- vsphere_guest:
vcenter_hostname: x.x.x.x
username: myuser
password: mypass
guest: newvm01
from_template: yes
template_src: sometemplate
cluster: MainCluster
resource_pool: "temppool"
validate_certs: False
When I ran the playbook in the verbose(-vvv) mode, the following things were observed:
----------------------------------------------------------------------------------------------------------------------------------
fatal: [127.0.0.1]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"cluster": "MainCluster",
"esxi": {},
"force": false,
"from_template": true,
"guest": "newvm01",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"power_on_after_clone": true,
"resource_pool": "temppool",
"snapshot_to_clone": null,
"state": "present",
"template_src": "sometemplate",
"username": "myuser}",
"validate_certs": false,
"vcenter_hostname": "x.x.x.x",
"vm_disk": {},
"vm_extra_config": {},
"vm_hardware": {},
"vm_hw_version": null,
"vm_nic": {},
"vmware_guest_facts": null
},
"module_name": "vsphere_guest"
},
"msg": "Cannot connect to x.x.x.x: [InvalidLoginFault]: Cannot complete login due to an incorrect user name or password."
}
PLAY RECAP *********************************************************************
127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1
The password value is not getting reflected for the json key password.