Skip to content

Instantly share code, notes, and snippets.

@wfaler
Created May 11, 2014 20:04
Show Gist options
  • Save wfaler/00ea10ac0ca0938cf352 to your computer and use it in GitHub Desktop.
Save wfaler/00ea10ac0ca0938cf352 to your computer and use it in GitHub Desktop.
Ensure your Ansible script doesn't hang on doing ssh operations (like pulling from github)
- name: ensure known hosts
shell: touch ~/.ssh/known_hosts creates=~/.ssh/known_hosts
- name: remove github.com from known host
shell: ssh-keygen -R github.com
- name: ensure github.com in known host
shell: ssh-keyscan -H github.com > ~/.ssh/known_hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment