dgolja / golja-gnupg

Puppet module for managing GnuPG package and public keys
Apache License 2.0
13 stars 46 forks source link

Proxy #17

Closed ajmaidak closed 7 years ago

benhocker commented 7 years ago

Is this PR ready to merge? I'd love proxy support

edestecd commented 7 years ago

We need proxy support... Ping

dgolja commented 7 years ago

sure ... i will release the new version this week, however let me test it properly on different environments.

edestecd commented 7 years ago

This works well in our environment on CentOS 7.2

edestecd commented 7 years ago

I'm getting the error about empty? now as well. We recently switched to puppet 4, so maybe that's it.

edestecd commented 7 years ago

I think empty works in puppet 3 and nil works in puppet 4... I'm submitting a PR to fix this now....

jwstric2 commented 7 years ago

@edestecd I hit this in 3.8.7 puppet with ruby 2.0.0 .. see above for error (seems the same from your description) with potential fix (we are running this diff with fix in our production env). From above comment:


In my environment, I had to set this to .nil? With .empty? I received the following:

Debug: Executing 'gpg --list-keys --with-colons D39DC0E3' Error: Could not set 'present' on ensure: undefined method empty?' for nil:NilClass at 13:/root/sysadmin-puppet/modules/rvm/manifests/gnupg_key.pp Error: Could not set 'present' on ensure: undefined methodempty?' for nil:NilClass at 13:/root/sysadmin-puppet/modules/rvm/manifests/gnupg_key.pp Wrapped exception: undefined method empty?' for nil:NilClass Error: /Stage[main]/Rvm::Gnupg_key/Gnupg_key[rvm_D39DC0E3]/ensure: change from absent to present failed: Could not set 'present' on ensure: undefined methodempty?' for nil:NilClass at 13:/root/sysadmin-puppet/modules/rvm/manifests/gnupg_key.pp

After setting to "if resource[:proxy].nil?" receive the below:

Debug: Executing 'gpg --list-keys --with-colons D39DC0E3' Debug: Executing 'gpg --keyserver hkp://keys.gnupg.net --keyserver-options http-proxy=http://myproxy.company.com:80 --recv-keys D39DC0E3'

ruby 2.0.0p598 (2014-11-13) [x86_64-linux] puppet 3.8.7