title: chef cookbook lwrp, easiest way to use new_resource.updated_by_last_action(true)
body: <p>I'm writing a LWRP for chef 10.
  And when that resource is run in other recipes it should be marked as "updated_by_last_action" if something has changed. But if nothing has changed. updated_by_last_action should be false.</p>
  
  <p>So as example I have chef documentation <a href="http://docs.opscode.com/lwrp_custom_provider.html#updated-by-last-action" rel="nofollow">http://docs.opscode.com/lwrp_custom_provider.html#updated-by-last-action</a>. That example the resource template is wrapped inside an variable to test if it's been changed, and then set the updated_by_last_action status.
  So my code should look something like this</p>
  
  <pre><code>f = file new_resource.filename do
  xxx
  end
  new_resource.updated_by_last_action(f.updated_by_last_action?)
  
  t = template new_resource.templatename do
  xxx
  end
  new_resource.updated_by_last_action(t.updated_by_last_action?)
  
  m mount new_resource.mountpoint do
  xxx
  end
  new_resource.updated_by_last_action(m.updated_by_last_action?)
  </code></pre>
  
  <p>But if a provider gets bigger and uses a lot of resources like template, file, directory, mount, etc..
  Should all those resource be wrapped inside variables like the example to find out if a resource have been updated, so to then further send a status that this provider have been updated.</p>
  
  <p>I'm wondering if there is a simpler and cleaner way to run <code>new_resource.updated_by_last_action(true)</code> other then to wrap all resources inside variables. Cause if I just put a <code>new_resource.updated_by_last_action(true)</code> inside <code>action</code> before <code>end</code> the LWRP is marked as being updated every chef run, which is not optimal.</p>