I’m updating a project (setting up a disposable dev environment) from ansible 1.6.2 to 1.7. (Installed and upgraded using pip into a venv).
I’ve been setting up a user on the host that I’m configuring, with a full set of files in .ssh for things like the config (to assign an alias to github), known_hosts, and my key to connect to github.
I have a play that used to look like:
- name: Clone repositories
git: force=no
repo=ssh://gh/me/{{ item }}.git
dest=/home/foo/projects={{ item }}
key_file=/home/foo/.ssh/github_key
recursive=yes
update=yes
accept_hostkey=yes
with_items: - bar
- baz
- quux
After the upgrade, I started getting this error from each repo:
failed: [host] => (item=…) => {“failed”: true, “item”: “…”}
msg: failed to add gh hostkey: getaddrinfo gh: No address associated with hostname
Getting rid of accept_hostkey=yes switched the error message to:
msg: gh has an unknown hostkey. Set accept_hostkey to True or manually add the hostkey prior to running the git module
I did notice some messages about adding 192.30.252.128 (along with .130) to my list of known_hosts when
I ssh’d in or cloned the repo manually. (That doesn’t seem relevant, but the address looked suspicious to me).
The host that I’m configuring is running ubuntu trusty, inside an lxc.
Changing the repo address to ssh://git@github.com/me/{{ item }}.git seemed to have fixed the problem at first glance.
But now I can’t actually connect to any of those projects that I just cloned. “Permission denied (publickey).”
I can go through and run “git set-url” on each repo to go back to using what I think I actually want, but that’s a huge part of the pain I use ansible to avoid.
Have I missed something about this over the past few months? Or in the docs? Is this intended behavior and I’m missing something obvious?
Thanks, and apologies in advance if this is noise,
James