Hi All,
Here is my first simple “extract” module
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