Unarchive Module Failing with Return Code 11

Hi,

Version: 2.1.0.0

After a recent upgrade to the above version, I noticed that the unarchive module was failing with a return code of 11 (no matching files were found). So the line looked like this:

  • name: Decompress Deployment Zip
    unarchive: copy=no src=“{{ temp_dir }}/My.App.zip” dest=“{{ deploy_dir }}”

But I got this:

inflating: /tmp/deploy/myapp/version \n", “rc”: 11}, “failed”: true, “gid”: 0, “group”: “root”, “handler”: “ZipArchive”, “invocation”: {“module_args”: {“backup”: null, “content”: null, “copy”: false, “creates”: null, “delimiter”: null, “dest”: “/tmp/deploy/myapp”, “directory_mode”: null, “exclude”: , “extra_opts”: , “follow”: false, “force”: null, “group”: null, “keep_newer”: false, “list_files”: false, “mode”: null, “original_basename”: “My.App.zip”, “owner”: null, “regexp”: null, “remote_src”: null, “selevel”: null, “serole”: null, “setype”: null, “seuser”: null, “src”: “/tmp/My.App.zip”}}, “mode”: “0755”, “msg”: “failed to unpack /tmp/My.App.zip to /tmp/deploy/myapp”, “owner”: “root”, “secontext”: “unconfined_u:object_r:user_tmp_t:s0”, “size”: 4096, “src”: “/tmp/My.App.zip”, “state”: “directory”, “uid”: 0}

so I thought I would see if I got the same error using command and unzip:

  • name: Decompress Deployment Zip
    command: /usr/bin/unzip -o “{{ temp_dir }}/My.App.zip” -d “{{ deploy_dir }}”

This worked as expected. The really weird thing is, if I THEN ran the unarchive module line, it worked once more.

So after doing some tests, I found that it did not matter if the destination directory existed, it was created by Ansible or created at the command line, unarchive gave this error. Until I ran unzip using the command module.

So my question is this, is this a bug? Or has the behaviour changed in some way?

Many Thanks,
Stephen

Hi, Stephen

I think I’m seeing a similar outcome. I suspect something has changed with the way unarchive works in more recent versions.

I have a playbook that has the following lines in it:

- name: copy and unpack the artifacts to the host
  unarchive: src=../build/dist/jj.tar.gz dest=/home/users/sequation/www/documents/jj

These lines will work with ansible version 2.0.1.0 (and before). But using 2.1.1.0, I get ansible telling me that there is no change and therefore nothing is unarchived.

In the case where it works and it doesn’t, the destination directory exists prior to running the playbook.

This has been very frustrating.

Have you found anything to shed light on your issue?

Cheers, S t u a r t .