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

Proxy #17

Merged
merged 3 commits into from
Dec 8, 2016
Merged

Proxy #17

merged 3 commits into from
Dec 8, 2016

Conversation

ajmaidak
Copy link
Contributor

@ajmaidak ajmaidak commented Dec 7, 2015

No description provided.

@@ -53,7 +53,11 @@ def add_key
end

def add_key_from_key_server
command = "gpg --keyserver #{resource[:key_server]} --recv-keys #{resource[:key_id]}"
if resource[:proxy].empty?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work on this, minus the 1 note pertaining to ?empty ?nil on the resource it works great.

@benhocker
Copy link

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

@edestecd
Copy link
Contributor

edestecd commented Dec 8, 2016

We need proxy support... Ping

@dgolja dgolja merged commit 74bc23a into dgolja:master Dec 8, 2016
@dgolja
Copy link
Owner

dgolja commented Dec 8, 2016

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

@edestecd
Copy link
Contributor

edestecd commented Dec 8, 2016

This works well in our environment on CentOS 7.2

@edestecd
Copy link
Contributor

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

@edestecd
Copy link
Contributor

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

@jwstric2
Copy link

@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

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

Successfully merging this pull request may close these issues.

5 participants