Created
August 8, 2013 19:36
-
-
Save thehar/6187941 to your computer and use it in GitHub Desktop.
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
begin | |
require 'ruby-shadow' | |
user_pw = u['password'] | |
rescue LoadError | |
user_pw = nil | |
end | |
# Create user object. | |
# Do NOT try to manage null home directories. | |
user u['id'] do | |
uid u['uid'] | |
if u['gid'] | |
gid u['gid'] | |
end | |
shell u['shell'] | |
password user_pw | |
comment u['comment'] | |
if home_dir == "/dev/null" | |
supports :manage_home => false | |
else | |
supports :manage_home => true | |
end | |
home home_dir | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment