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
# In Chef, when a resource is defined all its variables are evaluated during | |
# compile time and the execution of the resource takes place in converge phase. | |
# So if the value of a particular attribute is changed in converge | |
# (and not in compile) the resource will be executed with the old value. | |
# Example problem: | |
# Let's consider this situation where there are two steps involved in a recipe | |
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed | |
# in converge phase | |
# Step 2 is a Chef resource that makes use of the node attribute that was |
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
#!/usr/bin/env ruby | |
recipe_path = ARGV[0] | |
if recipe_path.nil? | |
STDERR.puts "usage: chef-apply RECIPE_FILE" | |
exit 1 | |
end | |
recipe_path = File.expand_path(recipe_path) |