timed out waiting for ping module test success: Failed to connect to the host via ssh: Host key verification failed.
Closed this issue · 1 comments
cmoulliard commented
Issue
What should we do when such a message
TASK [ping hosts] *******************************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:18 +0100 (0:00:01.541) 0:00:34.915 ******
The authenticity of host '65.108.51.37 (65.108.51.37)' can't be established.
ECDSA key fingerprint is SHA256:WEc9QtD5mo24/t0BToxsp9PUPVFf79ROr4GPAXMQbJk.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
fatal: [h01-121]: FAILED! => {"changed": false, "elapsed": 389, "msg": "timed out waiting for ping module test success: Failed to connect to the host via ssh: Host key verification failed."}
is reported during the creation of the VM ? Is it created and customized zccording to the role or some steps are missing ?
ansible-playbook hetzner/ansible/hetzner-create-server.yml -e vm_name=${VM_NAME} -e salt_text=$(gpg --gen-random --armor 1 20) -e hetzner_context_name=snowdrop -e server_type=cx41
[WARNING]: * Failed to parse /Users/cmoullia/code/snowdrop/infra-jobs-productization/k8s-infra/ansible/inventory/id_openstack.rsa with ini plugin: /Users/cmoullia/code/snowdrop/infra-jobs-
productization/k8s-infra/ansible/inventory/id_openstack.rsa:1: Expected key=value host variable assignment, got: OPENSSH
[WARNING]: Unable to parse /Users/cmoullia/code/snowdrop/infra-jobs-productization/k8s-infra/ansible/inventory/id_openstack.rsa as an inventory source
PLAY [Create hetzner server] ********************************************************************************************************************************************************************************************
TASK [Gathering Facts] **************************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:43 +0100 (0:00:00.030) 0:00:00.030 ******
ok: [localhost]
TASK [Validate required variables] **************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:45 +0100 (0:00:01.994) 0:00:02.024 ******
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [Validate host is initialized in passwordstore] ********************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:45 +0100 (0:00:00.099) 0:00:02.124 ******
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [Get vm host vars] *************************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:45 +0100 (0:00:00.072) 0:00:02.196 ******
ok: [localhost]
TASK [Set default hetzner_context_name if it is not defined] ************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:46 +0100 (0:00:00.086) 0:00:02.283 ******
skipping: [localhost]
TASK [Pull pass git database] *******************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:46 +0100 (0:00:00.078) 0:00:02.362 ******
changed: [localhost]
TASK [Activate hetzner context] *****************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:48 +0100 (0:00:02.387) 0:00:04.750 ******
TASK [hetzner/activate_context : Set snowdrop context as active] ********************************************************************************************************************************************************
Thursday 27 January 2022 19:17:48 +0100 (0:00:00.078) 0:00:04.828 ******
changed: [localhost]
TASK [include_role : hetzner/create_server] *****************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:48 +0100 (0:00:00.354) 0:00:05.183 ******
TASK [hetzner/create_server : Get server public key from pass] **********************************************************************************************************************************************************
Thursday 27 January 2022 19:17:49 +0100 (0:00:00.065) 0:00:05.249 ******
ok: [localhost]
TASK [hetzner/create_server : Get server public key from file] **********************************************************************************************************************************************************
Thursday 27 January 2022 19:17:49 +0100 (0:00:00.214) 0:00:05.463 ******
skipping: [localhost]
TASK [hetzner/create_server : Get user password from pass] **************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:49 +0100 (0:00:00.025) 0:00:05.489 ******
ok: [localhost]
TASK [hetzner/create_server : Hash user password] ***********************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:49 +0100 (0:00:00.207) 0:00:05.696 ******
ok: [localhost]
TASK [hetzner/create_server : Get user home] ****************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:49 +0100 (0:00:00.049) 0:00:05.745 ******
ok: [localhost]
TASK [hetzner/create_server : Set user home] ****************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:49 +0100 (0:00:00.283) 0:00:06.029 ******
ok: [localhost]
TASK [hetzner/create_server : Template cloudinit file] ******************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:50 +0100 (0:00:00.220) 0:00:06.250 ******
changed: [localhost]
TASK [hetzner/create_server : Create cloud instance] ********************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:50 +0100 (0:00:00.752) 0:00:07.003 ******
changed: [localhost]
TASK [hetzner/create_server : Collect server information] ***************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:59 +0100 (0:00:08.474) 0:00:15.477 ******
changed: [localhost]
TASK [hetzner/create_server : Parse server information from hetzner] ****************************************************************************************************************************************************
Thursday 27 January 2022 19:17:59 +0100 (0:00:00.686) 0:00:16.164 ******
ok: [localhost]
TASK [hetzner/create_server : Set ip address] ***************************************************************************************************************************************************************************
Thursday 27 January 2022 19:17:59 +0100 (0:00:00.035) 0:00:16.199 ******
ok: [localhost]
TASK [hetzner/create_server : Clear known hosts for this server if it is newlly created] ********************************************************************************************************************************
Thursday 27 January 2022 19:17:59 +0100 (0:00:00.031) 0:00:16.231 ******
ok: [localhost]
TASK [Update inventory] *************************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:00 +0100 (0:00:00.618) 0:00:16.850 ******
TASK [passstore/ansible_inventory : Pull pass git database] *************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:00 +0100 (0:00:00.040) 0:00:16.890 ******
changed: [localhost]
TASK [passstore/ansible_inventory : Set the pass URL] *******************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:02 +0100 (0:00:01.751) 0:00:18.642 ******
included: /Users/cmoullia/code/snowdrop/infra-jobs-productization/k8s-infra/ansible/roles/passstore/ansible_inventory/tasks/set_pass_facts.yml for localhost
TASK [passstore/ansible_inventory : Set the pass URL] *******************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:02 +0100 (0:00:00.033) 0:00:18.676 ******
ok: [localhost]
TASK [passstore/ansible_inventory : Set pass fact 65.108.51.37] *********************************************************************************************************************************************************
Thursday 27 January 2022 19:18:02 +0100 (0:00:00.032) 0:00:18.709 ******
ok: [localhost]
TASK [passstore/ansible_inventory : Push changes to the pass git database] **********************************************************************************************************************************************
Thursday 27 January 2022 19:18:02 +0100 (0:00:00.302) 0:00:19.011 ******
changed: [localhost]
TASK [Get vm host vars] *************************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:17 +0100 (0:00:14.317) 0:00:33.328 ******
ok: [localhost]
TASK [Push changes to the pass git database] ****************************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:17 +0100 (0:00:00.045) 0:00:33.374 ******
changed: [localhost]
PLAY [Wait for the VM to boot and we can ssh] ***************************************************************************************************************************************************************************
TASK [ping hosts] *******************************************************************************************************************************************************************************************************
Thursday 27 January 2022 19:18:18 +0100 (0:00:01.541) 0:00:34.915 ******
The authenticity of host '65.108.51.37 (65.108.51.37)' can't be established.
ECDSA key fingerprint is SHA256:WEc9QtD5mo24/t0BToxsp9PUPVFf79ROr4GPAXMQbJk.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
fatal: [h01-121]: FAILED! => {"changed": false, "elapsed": 389, "msg": "timed out waiting for ping module test success: Failed to connect to the host via ssh: Host key verification failed."}
PLAY RECAP **************************************************************************************************************************************************************************************************************
h01-121 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
localhost : ok=24 changed=8 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0
Thursday 27 January 2022 19:24:48 +0100 (0:06:29.543) 0:07:04.459 ******
===============================================================================
ping hosts ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 389.54s
passstore/ansible_inventory : Push changes to the pass git database --------------------------------------------------------------------------------------------------------------------------------------------- 14.32s
hetzner/create_server : Create cloud instance -------------------------------------------------------------------------------------------------------------------------------------------------------------------- 8.47s
Pull pass git database ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.39s
Gathering Facts -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.99s
passstore/ansible_inventory : Pull pass git database ------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.75s
Push changes to the pass git database ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.54s
hetzner/create_server : Template cloudinit file ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 0.75s
hetzner/create_server : Collect server information --------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.69s
hetzner/create_server : Clear known hosts for this server if it is newlly created -------------------------------------------------------------------------------------------------------------------------------- 0.62s
hetzner/activate_context : Set snowdrop context as active -------------------------------------------------------------------------------------------------------------------------------------------------------- 0.35s
passstore/ansible_inventory : Set pass fact 65.108.51.37 --------------------------------------------------------------------------------------------------------------------------------------------------------- 0.30s
hetzner/create_server : Get user home ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.28s
hetzner/create_server : Set user home ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.22s
hetzner/create_server : Get server public key from pass ---------------------------------------------------------------------------------------------------------------------------------------------------------- 0.21s
hetzner/create_server : Get user password from pass -------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.21s
Validate required variables -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.10s
Get vm host vars ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.09s
Set default hetzner_context_name if it is not defined ------------------------------------------------------------------------------------------------------------------------------------------------------------ 0.08s
Activate hetzner context ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.08s
✘ ~/code/snowdrop/infra-jobs-productization/k8s-infra main ±
jacobdotcosta commented
That message should be accepted. It means the host ansible is connecting to for the first time, that should be the host recently created by the create-server
playbook, isn't included in the known_hosts
file so it isn't known yet. Answring Y
will include the host on the machines's known_hosts
file.