Skip to content

Instantly share code, notes, and snippets.

View fessmage's full-sized avatar

Aleksey Smirnov fessmage

View GitHub Profile
@fessmage
fessmage / add-to-ssh-known-hosts.yml
Created April 22, 2021 12:47
Add all hosts from ansible inventory to ssh known_hosts file of current user
- name: Gather facts from 'all' hosts in inventory
hosts: all
vars:
ansible_host_key_checking: false
ansible_ssh_extra_args: '-o UserKnownHostsFile=/dev/null'
tasks:
- setup:
gather_subset: network
- name: Add public keys to known_hosts file