Skip to content

Instantly share code, notes, and snippets.

@xayangjing
Forked from shirou/ssh_keyscan.yml
Created March 2, 2019 14:47
Show Gist options
  • Save xayangjing/5af62c173cc634274a6f4e6c050309ea to your computer and use it in GitHub Desktop.
Save xayangjing/5af62c173cc634274a6f4e6c050309ea to your computer and use it in GitHub Desktop.
run ssh-keyscan to add keys to known_hosts. This is a playbook for ansible
---
- hosts: all
gather_facts: no
sudo: no
tasks:
- name: run ssh-keyscan to add keys to known_hosts
local_action: shell ssh-keyscan {{ ansible_ssh_host }} >> ~/.ssh/known_hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment