-
Notifications
You must be signed in to change notification settings - Fork 135
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
kubernetes.core.kustomize lookup: support http proxy #783
Comments
Kubectl is a Go binary. By default, Go accepts the HTTP_PROXY, HTTPS_PROXY and NO_PROXY variable for the standard HTTP client. In my tests it has worked by simply adding the For now I've managed to make this work using the pipe plugin and the 'playbook_dir' and 'role_path` ansible variables, like so:
If you want to implement the proxy setting that would be nice, but it is no longer an issue for us, so closing is fine as well. |
I see Have you tried to use:
on the first look, it should work if kubectl supports HTTP_PROXY and HTTPS_PROXY environment variables. |
Yes I have, but the plugin does not seem to pass the environment on to the command by default, since the See
|
Thanks @bh-tt for the clarification, I know how to improve it and will create PR. |
Same result, I'm afraid this method does not work, as the You could add an 'environment' variable to the task itself? |
I see. But with PR #786
Parameter
and:
So, the local variable should be considered by the Yep, I can add |
I can confirm that adding the parameter in the actual ansible-playbook call works. You understand we would prefer not to set this environment value for every ansible call, especially since some tasks will need it while others may crash as they only communicate with local (e.g. not needing the http proxy) endpoints. Additionally, that would require a very good memory to remember which playbooks need it and which do not. |
Hi @bh-tt, now it should work in both ways, as the
Same PR with this state |
I think you're missing the definition of Is |
Then I'm satisfied, though I still think the typo'ed |
Even 'environment` seems work when I fix one another typo:
|
Why not just set the environment variable before you run |
Because we have about 200 playbooks and remembering which playbooks need which environment variable is not really something I'd like to do. Setting a default value is very hard for http proxy variables, since support varies a lot. Some applications support some form of wildcards, some do not, etc. |
SUMMARY
Kubernetes.core.kustomize lookup does not allow setting a HTTP proxy. This means we cannot use it to run kustomize with remote (e.g. github) bases/resources, since our ansible controller is on a system without direct access to the internet. I'd like to add a
proxy
(or maybehttp_proxy
) setting to the plugin to allow setting the proxy for use with this lookup.ISSUE TYPE
COMPONENT NAME
kubernetes.core.kustomize
ADDITIONAL INFORMATION
It allows ansible controllers behind a http proxy to access remote kustomize bases/resources. I've looked at several alternatives:
pipe
plugin, as that allows setting the HTTPS_PROXY variable, but that is not really usable as the PWD of the lookup becomes the playbook file, whereas most of our lookups will happen in rolesansible.builtin.command
, but again that results in PWD issuesThe text was updated successfully, but these errors were encountered: