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