ansible / ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.
https://www.ansible.com/
GNU General Public License v3.0
62.59k stars 23.86k forks source link

Unarchive Module dont work in clean Solaris 11.2 Sparc Environment. #14563

Closed sherlockholmes closed 6 years ago

sherlockholmes commented 8 years ago
Issue Type:

Ansible 2.0.2

Ansible Configuration:

As default

Environment:

Solaris 11.2 Sparc

Summary:

Unarchive module cant uncompress tar file.

Steps To Reproduce:

I test the command after crash my playbook, with different kinds files as well:

[rhugo@solarislol ~]$ ansible -i hosts solaris -u appadmin -m shell -a 'ls -lh /tmp'
10.77.142.195 | SUCCESS | rc=0 >>
total 723952

-rw-r--r--   1 appadmin otheruser   1007K Feb 18 15:42 apr-1.5.2.tar.gz

[rhugo@solarislol ~]$ ansible -i hosts solaris -u appadmin -m unarchive -a 'src=/tmp/apr-1.5.2.tar.gz dest=/tmp'
10.77.142.195 | FAILED! => {
    "failed": true,
    "msg": "ERROR! file or module does not exist: /tmp/apr-1.5.2.tar.gz"
}
[rhugo@solarislol ~]$ ansible -i hosts solaris -u appadmin -m unarchive -a 'src=/tmp/apr-util-1.5.4.tar.gz dest=/tmp'
10.77.142.195 | FAILED! => {
    "failed": true,
    "msg": "ERROR! file or module does not exist: /tmp/apr-util-1.5.4.tar.gz"
}
[rhugo@solarislol ~]$ ansible -i hosts solaris -u appadmin -m unarchive -a 'src=/tmp/smwa-12.52-sp01-cr04-sol-64.zip dest=/tmp'
10.77.142.195 | FAILED! => {
    "failed": true,
    "msg": "ERROR! file or module does not exist: /tmp/smwa-12.52-sp01-cr04-sol-64.zip"
Expected Results:

I test the same module in ubuntu and uncompress the tar file without problems.

Actual Results:

I think that is a problem of gnutar vs unix tar. Maybe unarchive don't work with the unix tar command.

passw0rd123 commented 8 years ago

Same Problem on Solaris 11.3 (x86) on Ansible 2.1.0.0 while 1.9.6 still works

I added a sample playbook and the verbose+debug logs for 2.1 and 1.9 to a gist: https://gist.github.com/passw0rd123/c1475ea4088f43427543119dca7a13f1

dagwieers commented 8 years ago

@passw0rd123 Can you try again with a more recent Ansible release, preferably the devel branch ?

Also, unarchive only works with GNU tar and unzip because it uses very specific functionality so it is more efficient in how it works. (i.e. it does not extract every time as it used to) We also scrape the output, so support for other tar commands is going to be very fragile.

ansibot commented 7 years ago

@sherlockholmes Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

mavit commented 7 years ago

You can install GNU tar on Solaris 11 with:

- pkg5: name=/archiver/gnu-tar
mator commented 7 years ago

solaris 11.3 sparc , ansible 2.2.1 installed from OpenCSW, can't reproduce

$ ls 
a                ansible-out.txt  cpu-prom.py      local.cshrc      local.login      local.profile
$ tar -czf /tmp/local.tar.gz local.*
$ ls /tmp
gdm-auth-cookies-Kb33Yc  hmptemp                  hsperfdata_ocm           local.tar.gz
$ cd a
~/a$ ansible localhost -i inventory.ini -m unarchive -a 'src=/tmp/local.tar.gz dest=/tmp'
localhost | SUCCESS => {
    "changed": true, 
    "dest": "/tmp", 
    "extract_results": {
        "cmd": [
            "/usr/bin/gtar", 
            "--extract", 
            "-C", 
            "/tmp", 
            "-z", 
            "-f", 
            "/export/home/mator/.ansible/tmp/ansible-tmp-1506451090.27-203335961212845/source"
        ], 
        "err": "", 
        "out": "", 
        "rc": 0
    }, 
    "gid": 3, 
    "group": "sys", 
    "handler": "TgzArchive", 
    "mode": "01777", 
    "owner": "root", 
    "size": 899, 
    "src": "/export/home/mator/.ansible/tmp/ansible-tmp-1506451090.27-203335961212845/source", 
    "state": "directory", 
    "uid": 0
}

$ ls /tmp
gdm-auth-cookies-Kb33Yc  hsperfdata_ocm           local.login              local.tar.gz
hmptemp                  local.cshrc              local.profile

$ ansible --version
ansible 2.2.1.0
  config file = /etc/opt/csw/ansible/ansible.cfg
  configured module search path = Default w/o overrides

$ uname -a
SunOS solaris 5.11 11.3 sun4v sparc SUNW,SPARC-Enterprise-T5120

$ pkg search -o path,pkg.name -l /usr/bin/gtar
PATH         PKG.NAME
usr/bin/gtar archiver/gnu-tar

$ pkg info archiver/gnu-tar
             Name: archiver/gnu-tar
          Summary: GNU version of the tar archiving utility
      Description: Tar is a program for packaging a set of files as a single
                   archive in tar format.
         Category: Development/GNU
            State: Installed
        Publisher: solaris
          Version: 1.27.1
    Build Release: 5.11
           Branch: 0.175.3.0.0.30.0
   Packaging Date: August 21, 2015 04:13:50 PM 
             Size: 1.80 MB
             FMRI: pkg://solaris/archiver/gnu-tar@1.27.1,5.11-0.175.3.0.0.30.0:20150821T161350Z
ansibotdev commented 6 years ago

@sherlockholmes You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help