<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">unarchive module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1"><pre class="notranslate"><code class="notranslate">ansible 2.3.1
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<h5 dir="auto">OS / ENVIRONMENT</h5>

<h5 dir="auto">SUMMARY</h5>
<p dir="auto">need a feature to extract single/multiple files from .zip file .  current unarchive module will unzip all the files to the destination folder</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">unarchive module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
This feature idea is really more geared towards Ansible &gt; 2.1"><pre class="notranslate"><code class="notranslate">ansible 2.1.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
This feature idea is really more geared towards Ansible &gt; 2.1
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">export ANSIBLE_NOCOWS=1</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">A Java JAR file is a ZIP file with a manifest and can be extracted using unarchive.  A Java JAR file can also be executed in place.  It's pretty common to extract specific files from a Java JAR file (such as properties files) so that you can alter the execution environment.  In the case below, I simply want to extract the icon file to add a launcher for Burp Suite to the menu.<br>
In any case, there are many other instances when it would be convenient to unarchive a limited set of files from an archive.  The "exclude" parameter provides a similar function, but wouldn't be convenient in this case as there are thousands of files and a complex directory hierarchy in this archive.  Since I'm not on 2.1 yet (Xubuntu), I don't have the exclude feature yet but used the command module to run unzip instead.  The only annoying aspect to this technique is that Ansible tells me I should be using the unarchive module.<br>
Low priority but potentially very useful ... and thanks for hard work you all put in!</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">The following play extracts a single file as needed:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: extract the application's icon from the archive
  command: unzip {{ burp_installation_directory }}/{{ burp_file }} {{ burp_icon_path }}/{{ burp_icon_file }}
           chdir={{ burp_installation_directory }}
           creates={{ burp_installation_directory }}/{{ burp_icon_path }}/{{ burp_icon_file }}
  tags:
    - burp_suite
    - security"><pre class="notranslate"><code class="notranslate">- name: extract the application's icon from the archive
  command: unzip {{ burp_installation_directory }}/{{ burp_file }} {{ burp_icon_path }}/{{ burp_icon_file }}
           chdir={{ burp_installation_directory }}
           creates={{ burp_installation_directory }}/{{ burp_icon_path }}/{{ burp_icon_file }}
  tags:
    - burp_suite
    - security
</code></pre></div>
<p dir="auto">But also generates a warning that I'm using the wrong module for the job.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [burp_suite : extract the application's icon from the archive] ************
changed: [localhost]
 [WARNING]: Consider using unarchive module rather than running unzip"><pre class="notranslate"><code class="notranslate">TASK [burp_suite : extract the application's icon from the archive] ************
changed: [localhost]
 [WARNING]: Consider using unarchive module rather than running unzip
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<h5 dir="auto">ACTUAL RESULTS</h5>