Skip to content

Instantly share code, notes, and snippets.

@stevendanna
Last active September 2, 2015 08:57
Show Gist options
  • Save stevendanna/aa66d66c222b6587cca6 to your computer and use it in GitHub Desktop.
Save stevendanna/aa66d66c222b6587cca6 to your computer and use it in GitHub Desktop.
file "bar"
file "baz"
log "foo" do
only_if do
resources("file[bar]").updated ||
resources("file[baz]").updated
end
end
node.default["whatever_needs_restart"] = false
file "bar" do
notifies :run, "ruby_block[whatever_needs_restart]", :immediately
end
file "baz" do
notifies :run, "ruby_block[whatever_needs_restart]", :immediately
end
ruby_block "whatever_needs_restart" do
block do
node.default["whatever_needs_restart"] = true
end
action :nothing
end
log "restart something" do
only_if do
node.default["whatever_needs_restart"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment