Created
August 25, 2011 20:00
-
-
Save zamoose/1171709 to your computer and use it in GitHub Desktop.
Useful Puppet user definitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hopefully someone else will find these snippets useful. I've found them VERY | |
# helpful in defining local users that hew to the generally-accepted RedHat-ism | |
# of [local username] having an equivalent [local user primary group] with uid = gid. | |
# Improvements welcomed. | |
# | |
# ROCKS Cluster users generally need access to scratch directories on local storage, | |
# hence their more expansive definitions. | |
# | |
# This file should probably go in your [Puppet config dir]/manifests/definitions/ | |
# | |
define config_cluster_user($uid, $gid, $comment, $groups = "" ){ | |
group { $name: | |
ensure => present, | |
gid => $gid, | |
} -> user { $name: | |
ensure => present, | |
uid => $uid, | |
gid => $gid, | |
groups => $groups, | |
comment => $comment, | |
managehome => true, | |
} | |
file{ "/scr1/$name": | |
mode => "751", | |
owner => $name, | |
group => $name, | |
ensure => directory, | |
} | |
file{ "/scr2/$name": | |
mode => "751", | |
owner => $name, | |
group => $name, | |
ensure => directory, | |
} | |
} | |
define config_local_user($uid, $gid, $comment){ | |
group { $name: | |
ensure => present, | |
gid => $gid, | |
}-> user { $name: | |
ensure => present, | |
uid => $uid, | |
gid => $gid, | |
comment => $comment, | |
managehome => true, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Huh -- github doesn't understand Puppet manifests for syntax highlighting, I guess?