All pastes #940709 Raw Edit

Mine

public text v1 · immutable
·published 2008-03-13 06:06 UTC
rendered paste body
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
			}
		}
	}
	
}