Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

unarchive

ANSIBLE VERSION

$ ansible --version
ansible 2.4.0 (devel 5741712a09) last updated 2017/05/18 16:08:41 (GMT +200)
config file =
configured module search path = [u'/home/pvdputte/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/pvdputte/VC/vendor/ansible-master/lib/ansible
executable location = /home/pvdputte/VC/vendor/ansible-master/bin/ansible
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]

OS / ENVIRONMENT

Ubuntu 14.04 'Trusty', managing Debian 7.0 'Wheezy'

SUMMARY

unarchive in current master won't work with remote files anymore. Simply copying lib/ansible/plugins/action/unarchive.py and lib/ansible/modules/files/unarchive.py from ansible 2.3 makes it work again.

Perhaps also check out #17009

STEPS TO REPRODUCE

- name: "install AWStats"
unarchive:
remote_src: "yes"
src: "http://netix.dl.sourceforge.net/project/awstats/AWStats/7.5/awstats-7.5.tar.gz"
dest: "/tmp"
owner: "root"
group: "root"
keep_newer: "yes"
creates: "/tmp/awstats-7.5"

EXPECTED RESULTS

It is expected that the file will be properly downloaded and extracted to the destination directory.

ACTUAL RESULTS

TASK [hclwrk-init : install AWStats] *******************************************
fatal: [com-dhclwrk001.srv.combell-ops.net]: FAILED! => {"changed": false, "failed": true, "msg": "Source 'http://netix.dl.sourceforge.net/project/awstats/AWStats/7.5/awstats-7.5.tar.gz' failed to transfer"}

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

unarchive

ANSIBLE VERSION

$ ansible --version
ansible 2.4.0 (devel 313591f8b8) last updated 2017/04/13 21:20:44 (GMT +200)
config file =
configured module search path = [u'/home/pvdputte/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/pvdputte/VC/vendor/ansible-master/lib/ansible
executable location = /home/pvdputte/VC/vendor/ansible-master/bin/ansible
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]

CONFIGURATION

Default

OS / ENVIRONMENT

Running from ubuntu 14.04LTS

Managing ubuntu 17.04 (only python 3 after base install)

SUMMARY

Attempting to run the unarchive task to download and extract an http URL yields an error "Source 'http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz' failed to transfer"

STEPS TO REPRODUCE

$ ansible-d targethost -e 'ansible_python_interpreter=/usr/bin/python3' -m unarchive -a "src=http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz dest=/tmp remote_src=true"

EXPECTED RESULTS

tar.gz file is fetched and extracted in the expected location. E.g. with python 2:

$ ansible-d targethost -m unarchive -a "src=http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz dest=/tmp remote_src=true"
targethost | SUCCESS => {
"changed": true,
"dest": "/tmp",
"extract_results": {
"cmd": [
"/bin/tar",
"--extract",
"-C",
"/tmp",
"-z",
"-f",
"/tmp/ansible_3W9Kei/SoapUI-5.3.0-linux-bin.tar.gz"
],
"err": "",
"out": "",
"rc": 0
},
"gid": 0,
"group": "root",
"handler": "TgzArchive",
"mode": "01777",
"owner": "root",
"size": 4096,
"src": "/tmp/ansible_3W9Kei/SoapUI-5.3.0-linux-bin.tar.gz",
"state": "directory",
"uid": 0
}

ACTUAL RESULTS

ansible 2.3:

targethost | FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"attributes": null,
"backup": null,
"content": null,
"copy": true,
"creates": null,
"delimiter": null,
"dest": "/tmp",
"directory_mode": null,
"exclude": [],
"extra_opts": [],
"follow": false,
"force": null,
"group": null,
"keep_newer": false,
"list_files": false,
"mode": null,
"original_basename": "SoapUI-5.3.0-linux-bin.tar.gz",
"owner": null,
"regexp": null,
"remote_src": true,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz",
"unsafe_writes": null,
"validate_certs": true
}
},
"msg": "Failure downloading http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz, write() argument must be str, not bytes"
}

ansible 2.4:

targethost | FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"attributes": null,
"backup": null,
"content": null,
"copy": true,
"creates": null,
"delimiter": null,
"dest": "/usr/local",
"directory_mode": null,
"exclude": [],
"extra_opts": [],
"follow": false,
"force": null,
"group": null,
"keep_newer": false,
"list_files": false,
"mode": null,
"original_basename": "SoapUI-5.3.0-linux-bin.tar.gz",
"owner": null,
"regexp": null,
"remote_src": false,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz",
"unsafe_writes": null,
"validate_certs": true
}
},
"msg": "Source 'http://cdn01.downloads.smartbear.com/soapui/5.3.0/SoapUI-5.3.0-linux-bin.tar.gz' failed to transfer"
}

Using ansible + python 2 to download on the target system works fine.

At first I thought it would be similar to #19710, but apparently something related has already changed in master, as the 2.4 output looks different.