# Ansible does not properly extract a tarball using unarchive module?

**URL:** <https://forum.ansible.com/t/ansible-does-not-properly-extract-a-tarball-using-unarchive-module/23341>\
**Category:** Ansible Project\
**Created:** [December 28, 2016, 9:59pm UTC](https://forum.ansible.com/t/ansible-does-not-properly-extract-a-tarball-using-unarchive-module/23341 "2016-12-28T21:59:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![burns498](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@burns498](https://forum.ansible.com/u/burns498)\
**Post date:** [December 28, 2016, 9:59pm UTC](https://forum.ansible.com/t/ansible-does-not-properly-extract-a-tarball-using-unarchive-module/23341/1 "2016-12-28T21:59:19Z")

</div>

Hello - I’m seeking some assistance in unpackaging a tarball using Ansible.

I’m using the unarchive module to unpackage a tarball to a remote server. The tarball is stored localled on the Ansible server, and I want it extracted on the target server.

**Code Snippet:**

`

- name: Prepare variables for WM dal\_SDN180.tar changes  
set\_fact:  
filename=“dal\_SDN180.tar”  
ma\_app=“WM”

- name: Deploy file to target

# Unzip using Ansible unarchive module

tags: deploy  
unarchive:  
src: “{{ filename }}”  
dest: “{{ WMS\_HOME }}/swtools/”  
register: deployed\_copy\_output  
`

**-vvv output:**

> ok: [ptl01a0fap006] =\> {“changed”: false, “dest”: “/apps/scope/manh/WM/swtools/”, “gid”: 2345, “group”: “g\_wmspt”, “handler”: “TarArchive”, “invocation”: {“module\_args”: {“backup”: null, “content”: null, “copy”: true, “creates”: null, “delimiter”: null, “dest”: “/apps/scope/manh/WM/swtools/”, “directory\_mode”: null, “exclude”: , “extra\_opts”: , “follow”: false, “force”: null, “group”: null, “keep\_newer”: false, “list\_files”: false, “mode”: null, “original\_basename”: “dal\_SDN180.tar”, “owner”: null, “regexp”: null, “remote\_src”: null, “selevel”: null, “serole”: null, “setype”: null, “seuser”: null, “src”: “/tmp/wmspt/ansible-tmp/ansible-tmp-1482960921.89-105630081213776/source”}}, “mode”: “0755”, “owner”: “wmspt”, “secontext”: “unconfined\_u:object\_r:unlabeled\_t:s0”, “size”: 4096, “src”: “/tmp/wmspt/ansible-tmp/ansible-tmp-1482960921.89-105630081213776/source”, “state”: “directory”, “uid”: 3267}

When run, the play considers the task “ok” even though I know the tar file has different contents than the target. The tar file contains the same files, but the contents of those file is different. I would expect Ansible to nptice this and then extract the tarball. I’m able to see this behavior with zip files, but not tar files. I did notice that if I manually delete one of the files on the target server, Ansible then extracts the entire tarball. Manually reverting a file and rerunning Ansible still does not extract the tarball.

Any thoughts on what I am missing here? I reviewed [this thread](https://github.com/ansible/ansible-modules-core/issues/2936) and tried setting pipelining to False, but it still had the same behavior.

Thanks
