Hello,
we provide user specific settings for our Maven repository via a HTTP
GET request[1], but have the usecase that "anonymous" has read-only
access, so authentication is not strictly enforced.
I try to setup our CI system with ansible coming from a shell based
setup, where I have:
curl --netrc -o ~/.m2/settings.xml http://repo/path/settings.xml
Now, curl sends the basic auth header in any case, while get_url[2]
waits for a 401 to come back before offering credentials. So with
get_url the credentials are not used but the settings.xml for
anonymous are downloaded.
I could implement a PR with an option to send authentication
preemptively and default to the current behavior.
On the other hand I think anyone using get_url with url_password knows
that authentication is needed, so IMO sending the auth-header directly
by default would be more useful and the current behavior only produces
the overhead of additional requests.
Regards Mirko
[1] we use Artifactory templating here.
[2] inspecting ansible/module_utils/urls.py