Created
March 17, 2016 20:45
-
-
Save gbirke/da1eccec6e81a2c9bd55 to your computer and use it in GitHub Desktop.
Ansible - Add github.com to list of known hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Check if github.com is a known host | |
command: ssh-keygen -H -F github.com -f {{ known_hosts_file }} | |
register: github_is_known | |
ignore_errors: True | |
- name: Add github to known hosts | |
shell: ssh-keyscan -H github.com >> {{ known_hosts_file }} | |
when: github_is_known.stdout == "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment