Hey everyone,
I been trying to figure how to manage public ssh keys with the following
code. For some reason I'm unable to add public ssh-keys to known_hosts.
When I run this code from a node it doesn't trow any errors and runs
without a problem but I think I'm missing something here that I don't see.
Any help would be greatly appreciated. Thanks.
This is my ssh_keys.pp
1 class ssh_keys {
2 define ssh_user($key) {
3 user { $name:
4 ensure => present,
5 managehome => true,
6 }
7
8 file { "/home/${name}/.ssh":
9 ensure => directory,
10 mode => '0700',
11 owner => $name,
12 }
13
14 ssh_authorized_key { "${name}_key":
15 key => $key,
16 type => 'ssh-rsa',
17 user => $name,
18 require => File["/home/${name}/.ssh"],
19 }
20 }
21
22 @ssh_user { 'user.test':
23 key => 'thisisthebestburrito',
24 }
25 }
My site.pp
node 'my-node-name' {
include ssh_keys
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/0ddd0de7-bf14-4fd4-9aea-bec1dd5ed9e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.