# Extract module - looking for feedback

**URL:** <https://forum.ansible.com/t/extract-module-looking-for-feedback/13291>\
**Category:** Ansible Project\
**Created:** [August 13, 2013, 5:57pm UTC](https://forum.ansible.com/t/extract-module-looking-for-feedback/13291 "2013-08-13T17:57:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Horbach](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Dmitry\_Horbach](https://forum.ansible.com/u/Dmitry_Horbach)\
**Post date:** [August 13, 2013, 5:57pm UTC](https://forum.ansible.com/t/extract-module-looking-for-feedback/13291/1 "2013-08-13T17:57:19Z")

</div>

Hi All,

Here is my first simple “extract” module

[https://github.com/dhorbach/ansible/blob/extract/library/files/extract](https://github.com/dhorbach/ansible/blob/extract/library/files/extract)

I’m looking for suggestions / improvements to it (also any Python coding tips).  
Archive type is automatically detected with “file” command.

Some examples:

# Extract /opt/file.zip to the same directory

# “extract\_dir” fact will be set to “/opt/file.zip.unpacked”

- extract: \>  
src=/opt/file.zip

# Extract /opt/file.tar.gz to /opt/content

# “extract\_dir” fact will be set to “/opt/content”

- extract: \>  
src=/opt/file.tar.gz  
dest=/opt/content

# Extract /opt/file.tar.gz to /opt/content and set custom fact “target\_dir”

# “target\_dir” fact will be set to “/opt/content2”

- extract: \>  
src=/opt/file.tar  
dest=/opt/content2  
fact=target\_dir

Regards,  
Dmitry
