300-910 · Question #46
Which action resolves the error?
The correct answer is C. Export the ANSIBLE_HOST_KEY_CHECKING=False variable. The error, likely related to SSH host key verification, can be resolved by temporarily disabling Ansible's strict host key checking mechanism.
Question
Options
- APush the Paramiko library on the host that runs Ansible
- BGenerate a new SSH key pair and add the public key to the target machine
- CExport the ANSIBLE_HOST_KEY_CHECKING=False variable
- DComment out the StrictHostKeyChecking=yes line from ansible.cfg
How the community answered
(27 responses)- A4% (1)
- C89% (24)
- D7% (2)
Why each option
The error, likely related to SSH host key verification, can be resolved by temporarily disabling Ansible's strict host key checking mechanism.
Paramiko is an SSH library used by Ansible; it is a prerequisite usually installed with Ansible, and 'pushing' it is not a standard or relevant action to resolve an SSH host key verification error.
Generating and adding a new SSH key pair resolves client authentication issues, not issues related to the server's identity verification (host key checking).
When Ansible encounters an unknown host key or a changed host key, it will typically fail with an error like 'Host key verification failed'. Exporting the `ANSIBLE_HOST_KEY_CHECKING=False` environment variable instructs Ansible to bypass this strict host key verification for the current execution, allowing the connection to proceed without manual confirmation of the host key.
Commenting out `StrictHostKeyChecking=yes` in `ansible.cfg` might disable host key checking if the default behavior is `ask` or `yes`, but setting `ANSIBLE_HOST_KEY_CHECKING=False` is a more direct and often temporary override for Ansible specifically.
Concept tested: Ansible SSH host key checking configuration
Source: https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-host-key-checking
Topics
Community Discussion
No community discussion yet for this question.