puppetlabs-toy-chest / puppetlabs-package_updates

Package update discovery Puppet Face and custom Facter fact
12 stars 6 forks source link

Proxy settings #20

Closed fduranti closed 7 years ago

fduranti commented 8 years ago

Hi, I'm starting to check this module but I've a problem with "proxy". My machine, to go over internet, need a proxy and this module seems to not work if gem (and other software providers) don't have a proxy defined. Running the puppet package updates manually is not a big problem as I can just set the http_proxy/https_proxy manually before running it but the schedule at crontab cannot be changed. It would be nice to have an option to use a proxy server or at list an option with some "precommand" to put at cron so it's possible to define a proxy manually.

ccaum commented 8 years ago

The module only interacts locally with the package managers on the node (apt/yum/gem/etc.) I'm assuming you need to configure those to use a proxy in order for them to perform cache updates and external repository queries? If not, how do you use those package managers with a proxy?

fduranti commented 8 years ago

Normally on servers I just need to check for yum updates and those are configured with an internal package repository or with a proxy if they need to access internet. The problem seems to be related to the fact that the package_updates try all the "provider" that find on the server and if one get an error (or get a timeout) it don't report results for other.

For example I have a server with os gem,puppet gem and pip. I should configure the proxy for every provider or puppet package updates does not work. If i configure all the proxy it works correctly. If I miss just one of the provider it will not work, it simply fail silently after some minutes without reporting any other packages from other providers.

It would be nice if when failing it would still report packages for other providers or a configuration option that will let the user just to a puppet package updates --provider=yum

ccaum commented 8 years ago

Interesting. Yes, that's definitely a bug. The tool is supposed to move on to the next provider if one fails. I'll take a look as soon as I can. Thanks for reporting

fduranti commented 7 years ago

I've added a PR with code to add a precommand execution so that it's possible to setup a proxy.

ccaum commented 7 years ago

Fixed with PR #21