HI,
im running on ansible 2.4.2 and trying to get a file from sharepoint, but always gotten 401 Unauthorized error (even i confirmed that the password is correct)
fatal: [hostname → localhost]: FAILED! => {
“changed”: false,
“dest”: “filename”,
“invocation”: {
“module_args”: {
“attributes”: null,
“backup”: null,
“checksum”: “”,
“client_cert”: null,
“client_key”: null,
“content”: null,
“delimiter”: null,
“dest”: “filename”,
“directory_mode”: null,
“follow”: false,
“force”: true,
“force_basic_auth”: true,
“group”: null,
“headers”: null,
“http_agent”: “ansible-httpget”,
“mode”: null,
“owner”: null,
“regexp”: null,
“remote_src”: null,
“selevel”: null,
“serole”: null,
“setype”: null,
“seuser”: null,
“sha256sum”: “”,
“src”: null,
“timeout”: 10,
“tmp_dest”: null,
“unsafe_writes”: null,
“url”: “http://someurlhere/filename.txt”,
“url_password”: “VALUE_SPECIFIED_IN_NO_LOG_PARAMETER”,
“url_username”: “benny”,
“use_proxy”: true,
“validate_certs”: false
}
},
“msg”: “Request failed”,
“response”: “HTTP Error 401: Unauthorized”,
“state”: “absent”,
“status_code”: 401,
“url”: “http://someurlhere/filename.txt”,
}
My playbook is rather simple:
- name: get the lockdown script
get_url:
url: “http://someurlhere/filename.txt”,
url_username: “{{ url_username }}”
url_password: “{{ url_password }}”
dest: filename
force_basic_auth: yes
force: yes
validate_certs: no
delegate_to: localhost
i can open the URL link from browser, and also tried using curl and it works (curl -u benny:mypassword -o /tmp/a.sh http://someurlhere/filename.txt)
Anyone has any idea what is the cause ?
beside, my password contains special character “$”, i have tried to put them under double-quote in the url_password field as well, but didnt work.
Thank you