Skip to content

Instantly share code, notes, and snippets.

@rcreasey
Created December 14, 2009 23:02
Show Gist options
  • Save rcreasey/256526 to your computer and use it in GitHub Desktop.
Save rcreasey/256526 to your computer and use it in GitHub Desktop.
set_unless[:users] = Mash.new
set_unless[:groups] = Mash.new
developers Mash.new
developers[:jsmith] = {:password => '$1$1.UoruVN$SbJ5brbBSHJBHP.GL3Li81', :comment => "Joe Smith", :uid => 9204 }
developers[:bgray] = {:password => '$1$Hjrkl9/v$5UTUjH7jwzwkuRJ65n9Lo/', :comment => "Bill Gray", :uid => 9320 }
set[:users] = developers
include_recipe 'accounts'
developers = Mash.new
developers[:holie] = {:password => '$1$cYwnpTlP$41tKhDPAriNTS1XnqsZYo1', :comment => "Harold Oile", :uid => 4554 }
developers[:dmartin] = {:password => '$1$A/XPK6ui$jDNphYvk.fsPYnhc/506i/', :comment => "Danielle Martin", :uid => 4885 }
set[:users] = developers
groups = Mash.new
groups[:lamp] = {:gid => 5032, :members => ['holie', 'dmartin']}
set[:groups] = groups
include_recipe 'accounts'
package 'ruby-shadow'
node[:users].each do |u, config|
user u do
comment config[:comment]
uid config[:uid]
home "/home/#{u}"
shell "/bin/bash"
password config[:password]
supports :manage_home => false
action [:create]
end
end
node[:groups].each do |g, config|
group g do
gid config[:gid]
members config[:members]
append true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment