Hi Everyone,
I'm learning VMWare virtualization automation with Ansible but i have problem as per this screenshot
My environment :
OS : Linux Centos 8.4 (ansible controller) with Ansible 2.13.5
Hypervisor : ESXI 7 update 3 (target server to be configured)
I already create key pair certificate from Centos and write the public key to Esxi on path /etc/ssh/key-roots/authorized_keys but i still facing error SSL WRONG_VERSION_NUMBER
Please help me guys
I have gone through a number of documents and found that
1. this error is related to python version mismatch
2. Most documents show API connection over HTTPS, please see below links:
https://docs.ansible.com/ansible/2.9/scenario_guides/vmware_scenarios/vmware_requirements.html
https://docs.ansible.com/ansible/2.9/scenario_guides/vmware_scenarios/scenario_vmware_http.html
Have you tried after removing port:22 from your playbook?
Regards,
Sachchidanand
can you share the yaml file
Hello @ags97898722jkt,
If you are trying to reach the vAPI, it listens on HTTPS port 443, is it possible to copy the contents of your playbook here?
Hello,
This my Ansible Playbook code
---
- hosts: localhost
connection: local
gather_facts: true
# vars:
# ansible_ssh_private_key_file: /home/tester/.ssh/id_rsa
tasks:
- name: mengecek konfigurasi VMWare ESXI Server
community.vmware.vmware_host_facts:
hostname: "192.168.50.5"
username: "root@esx7-dev"
password: "********"
port: 22
validate_certs: false
delegate_to: "localhost"
Additional :
1. Ansible collection : community.vmware 3.5.0
2. Python library for Ansible : PyVmOmi 8.0.0.1.2
3. Python : version 3.9
Moderator not: I've replaced the password with asterisks.
André
next time i'm gonna obfuscate the password. thanks
thanks a lot
Hi,
Please try to login directly using the ssh command (using key) from ansible vm to esxi and see if any error is there. Run ssh in verbose mode to see more debugging information. Error seems to be ssl/tls version mismatch or cipher mismatch.
Also check the document and if it add any help to the issue:
https://kb.vmware.com/s/article/2151279
Regards,
Sachchidanand
Hello,
I've run SSH in verbose mode to login my ESXI server but there is no error regarding SSL/TLS in the verbose
No error means you are able to login directly via ssh, isn't it?
Second thing is from the screenshot I can see that your playbook is running for the "localhost". Is your esxi node's entry in the inventory file as "localhost" ?
Regards,
Sachchidanand
Hi,
Yes, i can login to ESXI using SSH successful without write password. in the playbook code the "localhost" means the code will access the PyVmOmi API then connect to ESXI using community.vmware collection
Also please confirm to which node IP 192.168.50.5 belongs to?
Regards,
Sachchidanand
Try updating your urllib3 library.
python -m pip install --upgrade urllib3
Hello,
Hi,
My urllib3 already the latest version, which is 2.0.4 version. i've run my playbook again, the error still same
I have gone through a number of documents and found that
1. this error is related to python version mismatch
2. Most documents show API connection over HTTPS, please see below links:
https://docs.ansible.com/ansible/2.9/scenario_guides/vmware_scenarios/vmware_requirements.html
https://docs.ansible.com/ansible/2.9/scenario_guides/vmware_scenarios/scenario_vmware_http.html
Have you tried after removing port:22 from your playbook?
Regards,
Sachchidanand
Hello,
I modify the playbook code to be :
- hosts: localhost
connection: local
gather_facts: true
vars:
# ansible_ssh_private_key_file: /home/tester/.ssh/id_rsa
tasks:
- name: mengecek konfigurasi VMWare ESXI Server
community.vmware.vmware_host_facts:
esxi_hostname: "esx7-dev"
hostname: "192.168.50.5"
username: "root"
password: "*************"
# port: 22
validate_certs: false
register: konfigurasinya_adalah
delegate_to: "localhost"
- name: konfigurasi ESXI Server
debug:
var: konfigurasinya_adalah
This is the result
I deactivate "port: 22" line
at this point this case is solved. Thanks everybody
can you share the yaml file
Hi @tayeb2020
Above is my yaml file
