Skip to content

Instantly share code, notes, and snippets.

@ffernand
Forked from holms/task.yml
Created December 13, 2016 12:49
Show Gist options
  • Save ffernand/39941220185310444e5ade1eb9bb6199 to your computer and use it in GitHub Desktop.
Save ffernand/39941220185310444e5ade1eb9bb6199 to your computer and use it in GitHub Desktop.
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment