Tuesday, 3 March 2020

STEP BY STEP PRACTICALS - ANSIBLE - HOW TO TEST CONNECTIVITY TO ESXI VIA ANSIBLE

Today we will see, how we can connect to ESXi via Ansible and test the ping-pong connectivity.

 

1) Ensble SSH on the ESXi host.

 This can be done by going to the below path:-

Click on Home and select the datacenter - select cluster and then select host.

Now go to configuration on the right hand pane and select Security Profile under - Software.

Select the Security Profile and click on Properties.

In the properties section, run the SSH service (Status to start).

 2) Copy your SSH public key to the ESXi Host.

Run the below command:-

 cat ~/.ssh/id_rsa.pub | ssh root@192.168.181.20 'cat >> /etc/ssh/keys-root/authorized_keys'

Note:- Here the command ssh-copy-id won't work as we are copying it on the ESXi.

 3) Create an host file. In my example, I have created a host file with the name esxi

 4) Run the below command from the server:-

 cat ~/.ssh/id_rsa.pub | ssh root@192.168.181.20 'cat >> /etc/ssh/keys-root/authorized_keys' 

 5) Check the connection by running the below command:-

 

No comments:

Post a Comment