unable to create VM on esxi 7.0

I am creating a virtual machine using ansible. I received this error and do not know how to solve it. I am new student to both VMware and asnible. This is the error i received:

fatal: [localhost → localhost]: FAILED! => {“changed”: false, “msg”: “Unknown error while connecting to vCenter or ESXi API at vsecurity:443 : [Errno -3] Temporary failure in name resolution”}

Pleae your help is appreciated. I do not use a vcenter

You’re connecting to a host called ‘vsecurity’, but that doesn’t resolve to something.
At least not on the host you’re trying to run the playbook from.

Okay…thank you. I think now i am having a different error of certifiate.

fatal: [localhost → localhost]: FAILED! => {“changed”: false, “msg”: “Unable to connect to vCenter or ESXi API at vsecurity.com on TCP/443: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1123)”}

I tried to secure copy the rui.crt from vmware esxi via ssh to the ansible control node but it fails all the time.

You’re connecting to a host called ‘vsecurity’, but that doesn’t resolve to something.
At least not on the host you’re trying to run the playbook from.

Hi,

Please explain which module you are using when asking questions !

So have a guess that you are using this one

https://docs.ansible.com/ansible/2.8/modules/vmware_guest_module.html#vmware-guest-module

So two options :

  • ask to update the certificate with a trusted and not expired one

  • use “validate_certs” option

Regards,

JYL

Sure i will thanks. It is true, i am using the vmware_guest module where i ommited the validate certificate.
But now the problem has been with the dns.
when I test the management network, the hostname resolves to the dns, yet i ahve errors.

fatal: [localhost → localhost]: FAILED! => {“changed”: false, “msg”: “Unknown error while connecting to vCenter or ESXi API at vsecurity.localdomain:443 : [Errno -2] Name or service not known”}

Below is my commands…the control node is installed on the esxi

I am sorry to have been asking many questions.

Well this still is a resolution error, so that needs to be fixed.
Either way it’s not an ansible problem.

Thank you very much Jean for all the help so far…

Regards

Well this still is a resolution error, so that needs to be fixed.
Either way it’s not an ansible problem.