title: How to check for installed package in Puppet?
body: <p>I'm downloading a RPM using wget and I want to check if the package is installed before I download it. I'm not using a RPM repo, so I can't just do</p>
  
  <pre><code>package { ...
    ensure =&gt; installed
  }
  </code></pre>
  
  <p>How can I do something like:</p>
  
  <pre><code>if HOW_TO_CHECK_IF_PACKAGE_X_IS_INSTALLED
     ... do wget etc.
  </code></pre>
  
  <p>Before someone asks, this didn't work for me: <a href="https://stackoverflow.com/questions/15266347/puppet-test-if-a-package-already-defined">Puppet - test if a package already defined?</a></p>