Created
November 18, 2015 01:50
-
-
Save natemccurdy/683c9b8b99ab3290a614 to your computer and use it in GitHub Desktop.
Automagically create known_hosts entries with Puppet
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
# This example shows how to automatically populate the SSH known_hosts file | |
# on a node so that SSH'ing to the node won't ask you to verify it's fingerprint. | |
# This requires a version of Facter that uses structure facts. | |
# Node 'foo' exports its public HOST KEY. | |
node 'foo' { | |
@@sshkey { $::clientcert: | |
ensure => present, | |
host_aliases => [$::ipaddress], | |
key => $::ssh['rsa']['key'], | |
type => 'rsa', | |
tag => 'foobar', | |
} | |
} | |
# Node 'bar' collects all exported HOST KEYS. | |
node 'bar' { | |
Sshkey <<| tag == 'foobar' |>> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment