Created
November 19, 2012 20:16
-
-
Save dylanz/4113604 to your computer and use it in GitHub Desktop.
Chef/Ruby
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
# This runs, but during the loading of the recipes, and not when the cookbook should be run: | |
# | |
%w{user1 user2 user3 user4 user5 user6}.each do |u| | |
puts "I see this output immediately on recipe load" | |
directory "/home/#{u.name}" do | |
etc... | |
end | |
bash "I think this might be running on recipe load, but not the directory directive above?" do | |
puts "Do stuff here" | |
end | |
etc... | |
end | |
#We tried putting it in a ruby_block, but then it complains about "directory" not being a valid directive: | |
# | |
ruby_block "adding the user stuff" do | |
%w{user1 user2 user3 user4 user5 user6}.each do |u| | |
directory "/home/#{u.name}" do | |
etc... | |
end | |
etc... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment