- name: Update ~/.ssh/known_hosts file
hosts: all
gather_facts: false
become: false
tasks:
- name: Update ~/.ssh/known_hosts
ansible.builtin.known_hosts:
name: "{{ inventory_hostname }}"
key: "{{ lookup('pipe', 'ssh-keyscan ' + inventory_hostname) }}"
delegate_to: localhost
Created
August 9, 2023 11:12
-
-
Save AnatomicJC/73d059d35cd751a39605a2f794d5b293 to your computer and use it in GitHub Desktop.
Ansible: Add keys to known host with ssh-keyscan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment