Last active
January 26, 2017 03:15
-
-
Save mrlesmithjr/71f0669dfb970b4904a7cbe8b8e46863 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: scan and register | |
command: "ssh-keyscan {{ item }}" | |
register: "host_keys" | |
changed_when: false | |
with_items: '{{ groups.all }}' | |
delegate_to: localhost | |
become: false | |
- name: write keys | |
template: | |
src: "ssh-hosts.j2" | |
dest: "/etc/ssh/ssh_known_hosts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment