Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
define userCreation ($name ,$uid, $group, $extraGroups="", $shell) { user { "$name": name => "$name", uid => "$uid", gid => "$group", groups => $extraGroups, shell => "$shell", home => "/home/$name", # require => Group[$group], ensure => present, } file { "/home/$name/": owner => "$name", group => "$group", mode => "700", source => "puppet:///users/home/$name", } $ssh_users +=["$name"] } define groupCreation ($name, $gid) { group {"$name": name => "$name", gid => "$gid", #cant think of a reason for duplicates so.. allowdupe => false, } } class engineeringUser { $ssh_users =["adam"] #setting this a variable so other files like sudo can use it $engineeringGroup = "Engineering" $engineeringGid = "11000" groupCreation { "$engineeringGroup": name => "$engineeringGroup", gid => "$engineeringGid", } userCreation { "adam": group => "$engineeringGid", # extraGroups => ["test2","test3"], shell => "/bin/bash", uid => "10000", name => "adam", require => Group["$engineeringGroup"], } }
This paste will be private.
From the Design Piracy series on my blog: