Created
May 16, 2011 11:16
-
-
Save theozaurus/974256 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
define :ssh_key, :key => nil, :sort => "private", :user => "root" do | |
unless node[:etc][:passwd].has_key?(params[:user]) | |
# Need to reload ohai if we can't find the user | |
ruby_block "reload_ohai" do | |
block do | |
o = Ohai::System.new | |
o.all_plugins | |
node.automatic_attrs.merge! o.data | |
end | |
end | |
end | |
# Fails here because the user does not exist, because the user resource has not been executed | |
user_home = node[:etc][:passwd][params[:user]][:dir] | |
user_group = node[:etc][:passwd][params[:user]][:gid] | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment