diff --git a/docs/docsite/rst/reference_appendices/galaxy.rst b/docs/docsite/rst/reference_appendices/galaxy.rst index 052e1974e47..352d79cb49c 100644 --- a/docs/docsite/rst/reference_appendices/galaxy.rst +++ b/docs/docsite/rst/reference_appendices/galaxy.rst @@ -120,7 +120,15 @@ Use the following example as a guide for specifying roles in *requirements.yml*: # from a webserver, where the role is packaged in a tar.gz - src: https://some.webserver.example.com/files/master.tar.gz - name: http-role + name: http-role-gz + + # from a webserver, where the role is packaged in a tar.bz2 + - src: https://some.webserver.example.com/files/master.tar.bz2 + name: http-role-bz2 + + # from a webserver, where the role is packaged in a tar.xz (Python 3.x only) + - src: https://some.webserver.example.com/files/master.tar.xz + name: http-role-xz # from Bitbucket - src: git+https://bitbucket.org/willthames/git-ansible-galaxy diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 25304abad7e..cf214c2e969 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -319,7 +319,7 @@ class GalaxyCLI(CLI): def execute_install(self): """ uses the args list of roles to be installed, unless -f was specified. The list of roles - can be a name (which will be downloaded via the galaxy API and github), or it can be a local .tar.gz file. + can be a name (which will be downloaded via the galaxy API and github), or it can be a local tar archive file. """ role_file = context.CLIARGS['role_file'] diff --git a/lib/ansible/galaxy/role.py b/lib/ansible/galaxy/role.py index 61776c88509..a7ecdc08ce4 100644 --- a/lib/ansible/galaxy/role.py +++ b/lib/ansible/galaxy/role.py @@ -256,12 +256,9 @@ class GalaxyRole(object): display.debug("installing from %s" % tmp_file) if not tarfile.is_tarfile(tmp_file): - raise AnsibleError("the file downloaded was not a tar.gz") + raise AnsibleError("the downloaded file does not appear to be a valid tar archive.") else: - if tmp_file.endswith('.gz'): - role_tar_file = tarfile.open(tmp_file, "r:gz") - else: - role_tar_file = tarfile.open(tmp_file, "r") + role_tar_file = tarfile.open(tmp_file, "r") # verify the role's meta file meta_file = None members = role_tar_file.getmembers()