Skip to content

Instantly share code, notes, and snippets.

@larsar
Forked from larstobi/user_larstobi.pp
Created November 14, 2011 13:01
Show Gist options
  • Save larsar/1363905 to your computer and use it in GitHub Desktop.
Save larsar/1363905 to your computer and use it in GitHub Desktop.
Puppet user resource
class user_larstobi {
$user = "larstobi"
group { "$user":
ensure => present,
allowdupe => false,
}
user { "$user":
comment => "Lars Tobias Skjong-Borsting",
gid => "$user",
home => "/home/$user",
shell => "/bin/bash",
password => 'NP',
profiles => "Primary Administrator",
ensure => present,
allowdupe => false,
managehome => true,
require => Group["$user"],
# require => $operatingsystem ? {
# "Solaris" => [ Group["$user"],
# Class["automount"] ],
# default => Group["$user"],
# }
}
Ssh_authorized_key {
type => "ssh-rsa",
user => "$user",
require => User["$user"],
}
ssh_authorized_key {
"${user}@machine1":
key => "AAAAB3...SinyibCxc=";
"${user}@machine2":
key => "AAAAB3NzaC...YNpc=";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment