Hey Jordan,
Thanks again for the help. One other related question - I notice that the win_uri call returns vastly different output than the Linux equivalent uri call. The same code run against a Linux host calling uri returns:
ok: [nm-win-worker01 → localhost] => {
“changed”: false,
“connection”: “close”,
“content”: “404 page not found\n”,
“content_length”: “19”,
“content_type”: “text/plain; charset=utf-8”,
“date”: “Sun, 25 Feb 2018 17:27:39 GMT”,
“failed_when_result”: false,
“invocation”: {
“module_args”: {
“attributes”: null,
“backup”: null,
“body”: null,
“body_format”: “raw”,
“client_cert”: null,
“client_key”: null,
“content”: null,
“creates”: null,
“delimiter”: null,
“dest”: null,
“directory_mode”: null,
“follow”: false,
“follow_redirects”: “safe”,
“force”: false,
“force_basic_auth”: false,
“group”: null,
“headers”: {
“Content-Type”: “application/json”
},
“http_agent”: “ansible-httpget”,
“method”: “POST”,
“mode”: null,
“owner”: null,
“regexp”: null,
“remote_src”: null,
“removes”: null,
“return_content”: false,
“selevel”: null,
“serole”: null,
“setype”: null,
“seuser”: null,
“src”: null,
“status_code”: [
“200”,
“500”
],
“timeout”: 30,
“unsafe_writes”: null,
“url”: “https://nm-ucp01.cloudra.local/_thereisnosuchpage”,
“url_password”: null,
“url_username”: null,
“use_proxy”: true,
“validate_certs”: false
}
},
“msg”: “Status code was not [200, 500]: HTTP Error 404: Not Found”,
“redirected”: false,
“status”: 404,
“url”: “https://nm-ucp01.cloudra.local/_thereisnosuchpage”,
“x_content_type_options”: “nosniff”
}
We get back the remote Web server’s status of 404 in the status field. It looks like win_uri only returns the status in a successful call, whereas the uri call always returns status. Our code was using the returned status to verify the uri/web_uri call but that doesn’t work when we’re intentionally searching for a page we know doesn’t exist. Do you know if this behavior will eventually sync up between Linux and Windows modules or is there a reason why win_uri only returns status on successful calls?
Thanks again,
Dave