unarchive requirements?

408 views
Skip to first unread message

Adam Morris

unread,
Jan 17, 2014, 1:58:39 PM1/17/14
to ansible...@googlegroups.com
Greetings,

According to the documentation unarchive requires tar/unzip to work...

However it appears from my first attempt at using it that it requires GNU tar to work.  Reading through the code it looks like it tries to determine what the archive format is and then supplies appropriate GNU tar options to the tar command in order to carry out its tasks.  

I haven't tested yet, but I suspect that I could provide it with an uncompressed tar file and have it work on AIX, but it certainly doesn't work with a compressed one.  

Does anyone have any thoughts on this?  I'm not sure how you could improve the module though...

Adam

Brian Coca

unread,
Jan 17, 2014, 2:01:22 PM1/17/14
to ansible...@googlegroups.com
Since I'm already taking a look for issues with BSD directory detection, I might take a stab at making sure it is 'POSIX tar' compliant, sadly I have a lot of experience with that.


--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno

Brian Coca

unread,
Jan 18, 2014, 8:27:22 PM1/18/14
to ansible...@googlegroups.com
So it seems the big issue is having the compression support in tar (as GNU tar has), for other implementations we would need to always call the decompression program (gzip, etc).

Leibo

unread,
Jun 17, 2014, 4:29:08 AM6/17/14
to ansible...@googlegroups.com

Just encountered this on a HP-UX server...

ansible -i inventory/test_hosts rx2600-hpux11iv3-x64 -u root -m shell -a "which tar"

rx2600-hpux11iv3-x64 | success | rc=0 >>
/usr/bin/tar

I suppose it would be nice to test the detected tar command flags, if we detect a 'z' option, use it, if not - do this in 2 steps - uncomress and unarchive

# ansible -i inventory/test_hosts rx2600-hpux11iv3-x64 -u root -m shell -a "tar z"
xavi-rx2600-hpux11iv3-x64 | FAILED | rc=1 >>
tar: z: unknown option

And failover to a 2 step solution.

Michael DeHaan

unread,
Jun 17, 2014, 3:11:18 PM6/17/14
to ansible...@googlegroups.com
We're unlikely to want to run the extra steps to do the test all the time, and it would complicate the module considerably, I'd accept  a PR to add a hint to the unarchive module though.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f6f28733-af68-412b-9ca4-1e9085eac1dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leibo

unread,
Jun 17, 2014, 3:21:06 PM6/17/14
to ansible...@googlegroups.com
Thanks,

if we can have a new parameter to explicitly tell the module to use 2 steps, like, gunzip and then tar xf it would cover this non GNU tar situations.

Michael DeHaan

unread,
Jun 17, 2014, 4:10:32 PM6/17/14
to ansible...@googlegroups.com
gnu=no (default yes) maybe?




On Tue, Jun 17, 2014 at 2:21 PM, Leibo <assaf...@gmail.com> wrote:
Thanks,

if we can have a new parameter to explicitly tell the module to use 2 steps, like, gunzip and then tar xf it would cover this non GNU tar situations.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

Leibo

unread,
Jun 17, 2014, 4:59:54 PM6/17/14
to ansible...@googlegroups.com
Hi,

gnu=no/yes is great. 

BTW, if we have other commands inside modules relying on GNU perhaps it will be good to have also a system level parameter that will affect all such modules.

Michael DeHaan

unread,
Jun 18, 2014, 11:33:58 AM6/18/14
to ansible...@googlegroups.com
We don't have any facility for module defaults like that at this time, so that may have to be considered later.

I'd consider it now if we didn't have so many other things to consider first :)

But yes, in this case, let's make gnu=yes/no so.


Reply all
Reply to author
Forward
0 new messages