All pastes #425645 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-05 16:45 UTC
rendered paste body
define ssh-authorized-keys ($authorizedkeys="standard-authorized-keys") {

	$homedir = $name ? {
		root => "/root",
		default => "/home/$name"
	}

	file {
		"$homedir/.ssh":
			ensure => directory,
			owner => "$name",
			group => "$name",
			mode => 0700;

		"$homedir/.ssh/authorized_keys":
			owner => "$name",
			group => "$name",
			mode => 0600,
			source => "puppet://puppet.dmacc.net/files/ssh/$authorizedkeys",
			require => [ File["$homedir/.ssh"], Package["openssh-clients"] ];
	}
}
$rancidhomedir = "/home/rancid"

class rancid-user {
        group {
                "rancid":
                        ensure => present;
        }

        user {
                "rancid":
                        ensure => present,
                        gid => "rancid",
                        home => "$rancidhomedir",
                        comment => "RANCID",
                        shell => "/bin/bash",
                        require => [ Group["rancid"] ];
        }

	ssh-authorized-keys {
		"rancid":
			authorizedkeys => "rancid-authorized-keys";
	}			
}