Skip to content

Instantly share code, notes, and snippets.

@chuckersjp
Created August 9, 2018 02:37
Show Gist options
  • Save chuckersjp/ebff8e6edc59029ac0cfced709148a25 to your computer and use it in GitHub Desktop.
Save chuckersjp/ebff8e6edc59029ac0cfced709148a25 to your computer and use it in GitHub Desktop.
gist to scan all inventory nodes and dump them to known_hosts
---
# copied from https://gist.github.com/shirou/6928012
- 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