Skip to content
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

Add proxy support #269

Closed
walkamongus opened this issue Jun 28, 2016 · 4 comments
Closed

Add proxy support #269

walkamongus opened this issue Jun 28, 2016 · 4 comments

Comments

@walkamongus
Copy link

Consul is unable to download from behind a proxy. Proxy parameters should be added and then passed down into the archive resources to enable this.

@solarkennedy
Copy link
Contributor

I don't think this is really necessary or advisable. This module uses
https://github.com/voxpupuli/puppet-archive#archive

You could either set your proxy at the system level (setting the http_proxy variable):
http://www.cyberciti.biz/faq/linux-unix-set-proxy-environment-variable/

Or if you really must do it in puppet, you should do it in such a way so that it applies to all modules, not just this one:

Archive {
  proxy_server => 'foo',
}

https://docs.puppet.com/puppet/latest/reference/lang_defaults.html

@walkamongus
Copy link
Author

Hi,

Thanks for the note on resource defaults.

I definitely wouldn't want to set a system-wide proxy as mentioned in the article you linked to. It seems to assume interactive and/or login shells. Also, a system-wide proxy setting will break connections to the local LAN unless your proxy is configured to do some sort of intelligent hairpinning for local LAN connections.

While the resource default works, I think there is a compelling argument against it. The resultant code:

Archive {
  proxy_server => 'foo',
}

class {'consul':
  param => 'bar',
  param => 'baz',
}

The Archive resource default does not appear to be related to anything. It only exists because of the knowledge of the internal implementation of the Consul module. I think having to do this is actually an argument for exposing a proxy setting in the Consul module's public interface. This is a pretty common situation with module dependencies -- very often you need to expose some of the interface of the internal modules in the interface of the containing module so that the behavior of the modules used internally can be changed.

Using the resource default could also potentially affect resources it shouldn't (Archive resource on local LAN that shouldn't go through proxy) if they happen to fall within its scope as well.

@solarkennedy solarkennedy reopened this Jun 28, 2016
@solarkennedy
Copy link
Contributor

Alright you have convinced me, but only as much to leave the issue open for you or someone else to make the PR. I just worry about exposing every single option to everything in a puppet module.

I understand that there is the use case for only using an http proxy with this one puppet module, but imo a proxy setting is a system-wide thing. (You use the no_proxy var to specify the names/ips to not use the proxy for)

@walkamongus
Copy link
Author

I agree it would be nice to be able to set this system-wide but it's up to each program as to whether it respects the *_proxy environment variables (and I've run into some that don't).

Thanks for reconsidering and reopening. After some internal deliberation, installation through proxy was abandoned in favor of another solution. I'm re-closing so you don't have the issue hanging around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants