[chef] Prevent resource from triggering multiple times in a single run


Chronological Thread 
  • From: Mark Selby < >
  • To:
  • Subject: [chef] Prevent resource from triggering multiple times in a single run
  • Date: Sat, 29 Aug 2015 13:42:39 -0700

remote_file “/var/tmp/somefile” do
    source “http://binfiles/somefile”
    owner “root”
    group “root”
    mode “0644”
    action :create
end

Lets just suppose that this is a somewhat expensive operation that may need to get called multiple times during a converge depending on what recipes the node is running. I would like to say “do not execute this resource if it has already been triggered during this run”

I would also not like to use a marker file if I can avoid it.

I know we have delayed execution but that is not what I want. I need this to trigger on the first call and then not again. Can I use the run_status or run_context to accomplish this?

Thanks!



Archive powered by MHonArc 2.6.16.

§