# unzip to unarchive

**URL:** <https://forum.ansible.com/t/unzip-to-unarchive/33696>\
**Category:** Ansible Project\
**Created:** [August 28, 2020, 4:41pm UTC](https://forum.ansible.com/t/unzip-to-unarchive/33696 "2020-08-28T16:41:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpescatore](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lpescatore](https://forum.ansible.com/u/lpescatore)\
**Post date:** [August 28, 2020, 4:41pm UTC](https://forum.ansible.com/t/unzip-to-unarchive/33696/1 "2020-08-28T16:41:24Z")

</div>

Hi all,  
I want to change this to unarchive:

- name: unpack-protos-bin  
shell: unzip -o /root/.ansible-management/file.zip -d /usr/local bin/protoc  
args:  
executable: /bin/bash  
notify:

- unpack-proto-includes

- name: unpack-proto-includes  
shell: unzip -o /root/.ansible-management/file.zip -d /usr/local include/\*  
args:  
executable: /bin/bash

This is what I have surmounted, but not sure if it’s correct:

- name: unpack-protos-bin  
unarchive:  
src: file.zip  
dest: /usr/local/bin/protoc  
notify:

- unpack-proto-includes

- name: unpack-proto-includes  
unarchive:  
src: [https://github.com/google/protobuf/releases/download/v3.4.0/file.zip](https://github.com/google/protobuf/releases/download/v3.4.0/file.zip)  
dest: /usr/local/include/\*

Can anyone tell me if I am correct, and if not, how to resolve?

---

<div class="post-metadata">

**Author:** ![lpescatore](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lpescatore](https://forum.ansible.com/u/lpescatore)\
**Post date:** [August 28, 2020, 4:42pm UTC](https://forum.ansible.com/t/unzip-to-unarchive/33696/2 "2020-08-28T16:42:12Z")

</div>

I’m also curious about how the -o and -d switches in the original playbook relate to the new.

---

<div class="post-metadata">

**Author:** ![lpescatore](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lpescatore](https://forum.ansible.com/u/lpescatore)\
**Post date:** [August 31, 2020, 9:48pm UTC](https://forum.ansible.com/t/unzip-to-unarchive/33696/3 "2020-08-31T21:48:30Z")

</div>

Bump - anyone?

---

<div class="post-metadata">

**Author:** ![nunocostadev](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nunocostadev/32/4530_2.png) [@nunocostadev](https://forum.ansible.com/u/nunocostadev)\
**Post date:** [September 2, 2020, 3:18pm UTC](https://forum.ansible.com/t/unzip-to-unarchive/33696/4 "2020-09-02T15:18:49Z")

</div>

I’m using something like below but I had to add _ignore\_errors_\*: yes\* due to what I believe is a bug in ansible and/or unarchive module.  
The task always fail but the files are extracted.

Got this workaround from [https://github.com/ansible/ansible/issues/27081#issuecomment-595842668](https://github.com/ansible/ansible/issues/27081#issuecomment-595842668)

- name: Unzip core plugins from war file  
unarchive:  
remote\_src: true  
src: “/home/user/gerrit-war/gerrit-3.2.3.war”  
extra\_opts:

- -j

- “/home/user/gerrit-war/gerrit-3.2.3.war”

- “WEB-INF/plugins/{{ item }}.jar”  
dest: “/home/user”  
loop:

- replication

- gitiles  
ignore\_errors: yes
