class ssh { } class ssh::client inherits ssh { Sshkey <<||>> } class ssh::server inherits ssh::client { file { "/root/.ssh/": owner => "root", group => "root", mode => "700", ensure => "directory" } file { "/root/.ssh/authorized_keys": owner => "root", group => "root", mode => "644", source => "puppet://$server/ssh/authorized_keys" } file { "/etc/ssh/sshd_config": owner => "root", group => "sys", mode => "644", source => "puppet://$server/ssh/sshd_config", notify => Service["ssh"] } service { "ssh": ensure => running, enable => true } case $sshrsakey { "": { err("no rsa sshkeys on $fqdn") } default: { @@sshkey { "$hostname.$domain": alias => [ "$hostname", "$ipaddress" ], type => ssh-rsa, key => $sshrsakey, ensure => present } } } }