title: How to delete *.web files only if they exist
body: <p>I need to create an Ansible playbook to delete the <code>*.web</code> files in a specific directory only if the files exists.</p>
  
  <p>OS : cent OS, Redhat 5x, 6x.</p>
  
  <p>I have tried the following with no success:</p>
  
  <pre><code> - stat: path=/opt/app/jboss/configuration/*.web
     register: web
   - shell: rm -rf /opt/app/jboss/configuration/*.web
     when: web.stat.exists
  </code></pre>