title: Puppet notify, before, require not working as intended
body: <p>I'm trying to create a relationship between a service resource and two exec resources. The service should trigger the Exec['before'] when something changes and start the Exec['after'] when the service has been modified.</p>
  
  <pre><code>class foobar (
  $debug = true
  ) {
  
      service { "sshd":
          ensure =&gt; 'stopped',
          notify =&gt; Exec['before']
      }
  
      exec { "before":
          command =&gt; "/bin/echo before",
          refreshonly =&gt; true,
      }
  
      exec { "after":
          refreshonly =&gt; true,
          command =&gt; "/bin/echo after",
      }
  
  }
  </code></pre>
  
  <p>I've tried literally everything but the Exec['before'] keeps getting triggered after the service:</p>
  
  <pre><code>Notice: Compiled catalog for puppet.puppettest.local in environment production in 0.55 seconds
  Notice: /Stage[main]/Foobar/Service[sshd]/ensure: ensure changed 'running' to 'stopped'
  Notice: /Stage[main]/Foobar/Exec[before]: Triggered 'refresh' from 1 events
  Notice: Applied catalog in 0.04 seconds
  </code></pre>
  
  <p>How can I make sure that the Exec['before'] runs before the service but only if there have been changes to the service and not with every run?</p>
  
  <p>kr</p>