ANSIBLE VERSION
ansible-2.2.1.0-1.el6.noarch
OS ENVIRONMENT
`
Red Hat Enterprise Linux Server release 6.8 (Santiago)
vCenter 6.0
`
While using the correct credentials for the account being used to complete the steps in playbook, a fail is returned stating the credentials are incorrect.
STEPS TO REPRODUCE
Run the following playbook
`
Create a new VM
- name: create new vm…
hosts: 127.0.0.1
connection: local
tasks: - vmware_guest:
hostname: xxx.xxx.local
username: user@xxx.local
password: password
validate_certs: False
esxi_hostname: hostname
datacenter: datacenter
folder: designated folder
name: newvm
state: poweredoff
disk: - size_gb: 10
type: thin
datastore: datastore
hardware:
memory_mb: 8192
num_cpus: 2
wait_for_ip_address: False
delegate_to: 127.0.0.1
`
EXPECTED RESULTS
VM creation as specified in the playbook
ACTUAL RESULTS
`
fatal: [127.0.0.1 → 127.0.0.1]: FAILED! => {
“apierror”: “(vim.fault.InvalidLogin) {\n dynamicType = ,\n dynamicProperty = (vmodl.DynamicProperty) ,\n msg = ‘Cannot complete login due to an incorrect user name or password.’,\n faultCause = ,\n faultMessage = (vmodl.LocalizableMessage) \n}”,
“changed”: false,
“failed”: true,
“invocation”: {
“module_args”: {
“datacenter”: “datacenter”,
“disk”: [
{
“datastore”: “datastore”,
“size_gb”: 10,
“type”: “thin”
}
],
“esxi_hostname”: “hostname”,
“folder”: “designated folder”,
“force”: false,
“hardware”: {
“memory_mb”: 8192,
“num_cpus”: 2
},
“hostname”: “xxx.xxx.local”,
“name”: “newvm”,
“name_match”: “first”,
“nic”: null,
“password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“state”: “poweredoff”,
“template_src”: null,
“username”: “user@xxx.local”,
“uuid”: null,
“validate_certs”: false,
“wait_for_ip_address”: false
},
“module_name”: “vmware_guest”
},
“msg”: “Cannot complete login due to an incorrect user name or password.”
}
`
One thing to note: there are a couple special characters in the password of the account being used to connect. I’m not certain if these special characters could be the hangup.
I am able to log into the vSphere appliance via three methods with the credentials provided in the playbook:
- via vSphere Web Client
- via vSphere Client ( thick )
- via ssh
I am relatively new to Ansible configuration / use. Any insight is appreciated.