Skip to content

Instantly share code, notes, and snippets.

@mitrofun
Forked from lxsameer/task.yml
Created August 31, 2020 17:30
Show Gist options
  • Select an option

  • Save mitrofun/c2e80570d5d05e6f48f7bad2234b33b8 to your computer and use it in GitHub Desktop.

Select an option

Save mitrofun/c2e80570d5d05e6f48f7bad2234b33b8 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