Skip to content

Instantly share code, notes, and snippets.

@anttti
Created September 17, 2015 07:41
Show Gist options
  • Save anttti/25da1da8dd4100a278e1 to your computer and use it in GitHub Desktop.
Save anttti/25da1da8dd4100a278e1 to your computer and use it in GitHub Desktop.
Ansible: Ensure a host is known
- name: ensure github.com is a known host
lineinfile:
dest: /home/vagrant/.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