title: execute puppet class if file is modified by some package
body: <p>I'm using puppet to deploy standardized ubuntu installs as well as configuration files.
  I'm facing a problem where installing a certain package (through a dependency), will overwrite a critical config file. Is there a way to monitor whether this file changes (get's overwritten by some package) and restore it's original content?
  what would be the best way of achieving this?</p>
  
  <p>This is the class which takes care of configuring <code>/etc/nsswitch.conf</code>:</p>
  
  <pre><code>class nsswitchconfig {
  
      # roll out nsswitch   
      class { 'nsswitch':
              passwd =&gt; ['compat'],
              group =&gt; ['compat'],
              hosts  =&gt; ['files'],
              automount =&gt; ['files'],
      }
  
      notify { "hate #8040": message =&gt; "work around bug #8040" }
  
  }
  </code></pre>
  
  <p>this is the class which overwrites <code>/etc/nsswitch.conf</code></p>
  
  <pre><code>class desktop {
  
      include nsswitchconfig
  
      $package_name = ["ubuntu-desktop" ]
      package { $package_name:
                  ensure =&gt; latest,
              }
   }
  </code></pre>