Hi everyone,
I am trying to find the best way of supporting HTTP proxies with the pip command.
pip accepts the proxy as a --proxy argument, which can be supplied with the new “extra_args” parameter on the dev branch.
But - how do I set this parameter globally without restating it for each and every pip command in my play?
Would it make sense to alias a command and supply global arguments there?
Is there a way to seed a module with defaults for the duration of a play?
Some other way?
Thanks,
I have a patch that adds configurable defaults to template (jinja2 defaults) it should not be hard to do the same for other modules.
Oren Shomron wrote:
Hi everyone,
I am trying to find the best way of supporting HTTP proxies with the pip
command.
pip accepts the proxy as a --proxy argument, which can be supplied with
the
new "extra_args" parameter on the dev branch.
But - how do I set this parameter globally without restating it for each
and every pip command in my play?
Would it make sense to alias a command and supply global arguments there?
Is there a way to seed a module with defaults for the duration of a play?
Some other way?
Easiest way? Use action: $pip and set pip to "pip yourargs" in your vars:
section.
Daniel
There's more to it than this, folks.
We actually have the proxy problem some at work.
pip didn't, at least at one point, support getting environment
variables from http_proxy. You have to specify it to the pip binary.
So while Daniel's shortcut will prevent needing to supply that to the
play more than once, it is also true that we need to modify the pip
module to support a proxy.
It is ALSO true that it is useful to set proxies for lots of other
commands, where I was suggesting we have some capability like:
- action: arbitrary
env: $my_env
where even is a hash like:
vars:
my_env:
http_proxy: http://blarg:8080
And that way, for any arbitrary command, we can easily add OS
enviornment variables on the front. This is something I'm going to
do if no one beats me to it first.
But it, at least to my knowledge, won't help pip unless it finally
respects those HTTP_PROXY setttings. Note, I'm just going off what I
heard from someone else about pip, have not actually attempted that
part yet.