title: Subscribe to packages in puppet
body: <p>Consider I have a profile that installs a package. After installation, it runs some <code>exec</code> commands. But these commands need to run only once when the package is first installed. </p>
  
  <pre><code>  package { 'package1':
      ensure =&gt; 'present'
    }
  
    exec { 'signal_package_conf':
          command     =&gt; 'systemctl restart package.service',
          path        =&gt; '/sbin:/bin:/usr/sbin:/usr/bin',
          refreshonly =&gt; true,
          subscribe   =&gt; Package['package1'],
        }
  </code></pre>
  
  <p><strong>But suppose this particular package gets installed as a dependency for another package in another profile.</strong></p>
  
  <p>When puppet comes to the <code>package1</code> resource, it will find that the package is already installed and will not install it again. Since puppet would not know of this implicit package dependency, will the subscription to the package still work and execute the command in the <code>exec</code> resource?</p>