Created
July 31, 2018 00:12
-
-
Save andymotta/9d79dba16aa7c22fb27c3df977cd5895 to your computer and use it in GitHub Desktop.
Scan host for public keys then add keys to knows_hosts (ssh)
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
# path default of known_hosts module is home of the user running the playbook, i.e. $HOME/.ssh/known_hosts | |
- name: find public key for stash | |
command: ssh-keyscan "{{ domain }}" | |
register: pub_key | |
- name: add public key for stash to known_hosts | |
known_hosts: | |
name: "{{ domain }}" | |
key: "{{ pub_key.stdout }}" | |
state: "present" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment