Hi all, im having problems with getting a method to run at convergence
instead of at cookbook compilation time.
I have a library consisting of a set a of methods (helper methods and
then one that uses the helpers to trigger a few resources) (used the
following as reference:
).
I then include the module in a recipe and call the necessary wrapper
function:
##############
class Chef::Recipe
include MyModule
end
mymodule_method
##############
What I am seeing is that the remote_file resource used in
mymodule_method isnt running but code that comes after it expecting it
to have worked then fails. Im assuming this is because the method is
running during cookbook compilation based on the output. Is there a way
I can prevent this from happening and only run at convergence?
I then include the module in a recipe and call the necessary wrapper
function:
##############
class Chef::Recipe
include MyModule
end
mymodule_method
##############
What I am seeing is that the remote_file resource used in mymodule_method
isnt running but code that comes after it expecting it to have worked then
fails. Im assuming this is because the method is running during cookbook
compilation based on the output. Is there a way I can prevent this from
happening and only run at convergence?
Run mymodule_method inside a ruby_block resource, because the contents
of the block are run at converge-time.