-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win_get_url doesn't use the proxy even if proxy_url is specified #58691
Labels
affects_2.8
This issue/PR affects Ansible v2.8
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
windows
Windows community
Comments
After some debug, I noticed --- /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_get_url.ps1.orig 2019-07-03 15:25:43.579725700 +0900
+++ /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_get_url.ps1 2019-07-03 15:35:17.172836200 +0900
@@ -90,7 +90,7 @@
if (-not $UseProxy) {
$web_request.Proxy = $null
- } elseif ($ProxyUri) {
+ } elseif ($Proxy) {
$web_request.Proxy = $Proxy
} Execution result is like this. $ ansible-playbook -vvv -i hosts test.yml
ansible-playbook 2.8.1
config file = /mnt/c/Users/user/tmp/ansible-bug/ansible.cfg
configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 2.7.15+ (default, Nov 27 2018, 23:36:35) [GCC 7.3.0]
Using /mnt/c/Users/user/tmp/ansible-bug/ansible.cfg as config file
host_list declined parsing /mnt/c/Users/user/tmp/ansible-bug/hosts as it did not pass it's verify_file() method
script declined parsing /mnt/c/Users/user/tmp/ansible-bug/hosts as it did not pass it's verify_file() method
auto declined parsing /mnt/c/Users/user/tmp/ansible-bug/hosts as it did not pass it's verify_file() method
Parsed /mnt/c/Users/user/tmp/ansible-bug/hosts inventory source with ini plugin
PLAYBOOK: test.yml ************************************************************************************************************************************************************************************************
1 plays in test.yml
PLAY [windows10] **************************************************************************************************************************************************************************************************
META: ran handlers
TASK [Download file via proxy] ************************************************************************************************************************************************************************************
task path: /mnt/c/Users/user/tmp/ansible-bug/test.yml:4
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_get_url.ps1
Pipelining is enabled.
<localhost> ESTABLISH WINRM CONNECTION FOR USER: domain\user on PORT 5986 TO localhost
EXEC (via pipeline wrapper)
changed: [localhost] => {
"changed": true,
"checksum_dest": "fbc9df670fe85f5e7464a618114bc5fd4f77f277",
"checksum_src": "fbc9df670fe85f5e7464a618114bc5fd4f77f277",
"dest": "C:\\Users\\user\\AppData\\Local\\Temp\\v2.8.1.zip",
"elapsed": 45.864948299999995,
"invocation": {
"module_args": {
"checksum": null,
"checksum_algorithm": "sha1",
"checksum_url": null,
"dest": "C:\\Users\\user\\AppData\\Local\\Temp",
"force": true,
"force_basic_auth": false,
"headers": {},
"proxy_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"proxy_url": "http://proxy.example.com:8080",
"proxy_username": "proxyuser",
"timeout": 10,
"url": "https://github.com/ansible/ansible/archive/v2.8.1.zip",
"url_password": null,
"url_username": null,
"use_proxy": true,
"validate_certs": true
}
},
"msg": "OK",
"size": 25088008,
"status_code": 200,
"url": "https://github.com/ansible/ansible/archive/v2.8.1.zip"
}
META: ran handlers
META: ran handlers
PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
ansibot
added
affects_2.8
This issue/PR affects Ansible v2.8
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
needs_triage
Needs a first human triage before being processed.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
windows
Windows community
labels
Jul 3, 2019
@kai2nenobu can you create a PR with your changes, seems like an easy fix. |
ansibot
removed
the
needs_triage
Needs a first human triage before being processed.
label
Jul 3, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
affects_2.8
This issue/PR affects Ansible v2.8
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
windows
Windows community
SUMMARY
win_get_url
doesn't use the proxy even ifproxy_url
is specified. Therefore, if I execute awin_get_url
task under a proxy restricted network, it fails with 407 error (Proxy Authentication Required).ISSUE TYPE
COMPONENT NAME
win_get_url
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Control machine is Ubuntu 18.04 on WSL.
Installed pip libraries
Target machine is Windows 10.
STEPS TO REPRODUCE
Inventory file (
hosts
) is as below.Playbook (
test.yml
) is as below.I applied a playbook like this, it fails with 407 error.
EXPECTED RESULTS
win_get_url
uses a proxy configuration and download a file successfully.ACTUAL RESULTS
win_get_url
doesn't use a proxy configuration and fails with 407 error.The text was updated successfully, but these errors were encountered: