Ansible-pull unknown hostkey.

I encountered an Ansible-pull “unknown hostkey” error.

Starting ansible-pull at 2014-06-03 11:17:00
localhost | FAILED >> {
    "failed": true, 
    "msg": "git.repo.com has an unknown hostkey. Set accept_hostkey to True or manually add the hostkey prior to running the git module"
}

After some digging around, turns out the latest Ansible has no such problem, but the installed “ansible 1.5.5” running the pull has. Apparently that used to be a bug.

Simple solution is obviously to upgrade, but why go for the simple solution. Turns out this ignores most of the options concerning host-keys, except /etc/ssh/ssh_known_hosts

That means that adding the repository ssh-key will enable you to pull the repository.

ssh-keyscan git.repo.com >> /etc/ssh/ssh_known_hosts

Fun fun.

Published by Gert

Person-at-large.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: