Hello - I’m seeking some assistance in unpackaging a tarball using Ansible.
I’m using the unarchive module to unpackage a tarball to a remote server. The tarball is stored localled on the Ansible server, and I want it extracted on the target server.
Code Snippet:
`
-
name: Prepare variables for WM dal_SDN180.tar changes
set_fact:
filename=“dal_SDN180.tar”
ma_app=“WM” -
name: Deploy file to target
Unzip using Ansible unarchive module
tags: deploy
unarchive:
src: “{{ filename }}”
dest: “{{ WMS_HOME }}/swtools/”
register: deployed_copy_output
`
-vvv output:
ok: [ptl01a0fap006] => {“changed”: false, “dest”: “/apps/scope/manh/WM/swtools/”, “gid”: 2345, “group”: “g_wmspt”, “handler”: “TarArchive”, “invocation”: {“module_args”: {“backup”: null, “content”: null, “copy”: true, “creates”: null, “delimiter”: null, “dest”: “/apps/scope/manh/WM/swtools/”, “directory_mode”: null, “exclude”: , “extra_opts”: , “follow”: false, “force”: null, “group”: null, “keep_newer”: false, “list_files”: false, “mode”: null, “original_basename”: “dal_SDN180.tar”, “owner”: null, “regexp”: null, “remote_src”: null, “selevel”: null, “serole”: null, “setype”: null, “seuser”: null, “src”: “/tmp/wmspt/ansible-tmp/ansible-tmp-1482960921.89-105630081213776/source”}}, “mode”: “0755”, “owner”: “wmspt”, “secontext”: “unconfined_u:object_r:unlabeled_t:s0”, “size”: 4096, “src”: “/tmp/wmspt/ansible-tmp/ansible-tmp-1482960921.89-105630081213776/source”, “state”: “directory”, “uid”: 3267}
When run, the play considers the task “ok” even though I know the tar file has different contents than the target. The tar file contains the same files, but the contents of those file is different. I would expect Ansible to nptice this and then extract the tarball. I’m able to see this behavior with zip files, but not tar files. I did notice that if I manually delete one of the files on the target server, Ansible then extracts the entire tarball. Manually reverting a file and rerunning Ansible still does not extract the tarball.
Any thoughts on what I am missing here? I reviewed this thread and tried setting pipelining to False, but it still had the same behavior.
Thanks