Docker jenkins container, host key verification failed
I’m creating a CI pipeline and development environment with Vagrant, Ansible and Docker. My goal is to have everything automated with a single command, no manual configuration involved. With single ansible-playbook command I should have fully functional continuous deployment pipeline, all the services dockerized.
Now here’s the problem. When I run the official Jenkins docker container and try to configure authentication for git, I get the following error
host key verification failed
I understand I could login into Jenkins container, ssh to git manually and accept the host key as trusted, when login for the first time. But this is absolute no-no, the connectivity should be handled automatically too.
How do I configure Jenkins docker container to trust the git server at creation, when the available tools are docker, ansible and vagrant?
One Solution collect form web for “Docker jenkins container, host key verification failed”
You can use Ansible’s known_hosts module for solving this problem.
This module adds the host key into the server’s
~/.ssh/known_hosts file, similar to what you describe as a manual step.
Please note the limitations of the module as well:
If you have a very large number of host keys to manage, you will find the template module more useful.