summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-01-26 09:45:59 -0800
committerJames Cammarata <jimi@sngx.net>2015-02-17 14:47:35 -0600
commit742715064e2d3461dcc12cd0995d72f7b5559542 (patch)
treea807bc9752527788704f0fc791952872e4a887f6
parent3732a8244d3af584d37caa49ee825b7bcdbdb0cf (diff)
downloadansible-modules-core-742715064e2d3461dcc12cd0995d72f7b5559542.tar.gz
Prefer gtar to tar
Fixes #702
-rw-r--r--files/unarchive.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/files/unarchive.py b/files/unarchive.py
index f46e52e0..9b990def 100644
--- a/files/unarchive.py
+++ b/files/unarchive.py
@@ -112,7 +112,11 @@ class TgzFile(object):
self.src = src
self.dest = dest
self.module = module
- self.cmd_path = self.module.get_bin_path('tar')
+ # Prefer gtar (GNU tar) as it supports the compression options -zjJ
+ self.cmd_path = self.module.get_bin_path('gtar', None)
+ if not self.cmd_path:
+ # Fallback to tar
+ self.cmd_path = self.module.get_bin_path('tar')
self.zipflag = 'z'
def is_unarchived(self):