# Unarchive and FreeBSD

**URL:** <https://forum.ansible.com/t/unarchive-and-freebsd/35986>\
**Category:** Ansible Project\
**Created:** [November 10, 2021, 5:32pm UTC](https://forum.ansible.com/t/unarchive-and-freebsd/35986 "2021-11-10T17:32:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norman\_Gray](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@Norman\_Gray](https://forum.ansible.com/u/Norman_Gray)\
**Post date:** [November 10, 2021, 5:32pm UTC](https://forum.ansible.com/t/unarchive-and-freebsd/35986/1 "2021-11-10T17:32:54Z")

</div>

Greetings.

I recently raised issue \<[https://github.com/ansible/ansible/issues/76264&gt;](https://github.com/ansible/ansible/issues/76264&gt;), connected to the behaviour of the `unarchive` module on FreeBSD. It was closed as a duplicate and, in effect, not-a-bug, with the indication that any further commentary or discussion would be more welcome here than on the bugparade.

So...

One workaround suggested is to install gtar on the target machine, but apart from that requiring a further package/task, it's arguably poor FreeBSD style to require tools that aren't part of the install (requiring Python in order to use Ansible is of course a necessary breach of that). FreeBSD (and I think the other BSDs as well) places something of a premium on using the tool-suite available in the stock install, where possible. Because of its dependence on an optional package (gtar), I would therefore class the `unarchive` module as ‘broken on stock FreeBSD’.

The alternative workaround of avoiding `unarchive`, and using the `command` module to untar archives, is more attractive, to the extent that it fits my perception of good style in this context.

I'd be interested in any thoughts.

Best wishes,

Norman

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [November 10, 2021, 6:05pm UTC](https://forum.ansible.com/t/unarchive-and-freebsd/35986/2 "2021-11-10T18:05:46Z")

</div>

Hello Norman,

I'm more pragmatic:

- name: Install GNU tar on Alpine Linux  
&nbsp;&nbsp;&nbsp;package:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: tar  
&nbsp;&nbsp;&nbsp;when: ansible\_os\_family == 'Alpine'

- name: Install GNU tar on FreeBSD  
&nbsp;&nbsp;&nbsp;package:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: gtar  
&nbsp;&nbsp;&nbsp;when: ansible\_os\_family == 'FreeBSD'

Yes it requires an extra task, but still better IMHO than inventing workarounds for unarchive.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
