Hi all. My particular environment doesn''t allow most of the machines to make direct external connections, so I send a lot of things through proxies. And now, I''m trying to figure out how to use puppet to install gems, via proxy. The gem command itself has a command line option, or honors the http_proxy environmental variable. But I don''t see how to use either of those without patching the gem provider. Has anyone solved this? I''m running on ubuntu hardy, with puppet 0.25.1. seph -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Turnbull
2010-Jan-08 03:06 UTC
Re: [Puppet Users] Install gem packages behind a proxy
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 seph wrote:> Hi all. My particular environment doesn''t allow most of the machines to > make direct external connections, so I send a lot of things through > proxies. And now, I''m trying to figure out how to use puppet to install > gems, via proxy. > > The gem command itself has a command line option, or honors the > http_proxy environmental variable. But I don''t see how to use either of > those without patching the gem provider. Has anyone solved this? > > I''m running on ubuntu hardy, with puppet 0.25.1.John Ferlito has a patch for this - inline: diff -ur puppet-0.25.0/lib/puppet/provider/package/gem.rb puppet.net/lib/puppet/provider/package/gem.rb - --- puppet-0.25.0/lib/puppet/provider/package/gem.rb 2009-09-04 22:54:19.000000000 +0000 +++ puppet.net/lib/puppet/provider/package/gem.rb 2009-11-24 12:52:44.000000000 +0000 @@ -75,6 +75,10 @@ # Always include dependencies command << "--include-dependencies" + if options = resource[:options] + command += options.split(/\s+/) + end + if source = resource[:source] begin uri = URI.parse(source) @@ -99,6 +103,11 @@ command << resource[:name] end + if build = resource[:build] + command << "--" + command += build.split(/\s+/) + end + output = execute(command) # Apparently some stupid gem versions don''t exit non-0 on failure if output.include?("ERROR") diff -ur puppet-0.25.0/lib/puppet/type/package.rb puppet.net/lib/puppet/type/package.rb - --- puppet-0.25.0/lib/puppet/type/package.rb 2009-09-04 22:54:19.000000000 +0000 +++ puppet.net/lib/puppet/type/package.rb 2009-11-24 12:56:53.000000000 +0000 @@ -207,6 +207,12 @@ isnamevar end + newparam(:options) do + desc "Options for the gem command" + end + newparam(:build) do + desc "Build options for the gem" + end newparam(:source) do desc "Where to find the actual package. This must be a local file (or on a network file system) or a URL that your specific Regards James Turnbull - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBS0ahFyFa/lDkFHAyAQJ1oQf/UF26jgu1iWfab8+6ScjKTP3GvrU/DM0D h86k0cK6f46nCOvp1JoB7EnTMSwxUlJyZqVdo6DynUHTiDBmChjlL6Pm8JTT7Lb+ SrJ1fnUbhVWPrqLAuyLQnRy+TY9uzxpIDLG9NSpJoqMNNOyeq46hSwwST/mzxN8O dYYuFlzTbo8+rkM4MOBsiGFThfzDzy/eMUE2zxeaMUJVIYIxGSljdYIw92xXDMuu o0/OQ4bMRztX4GuW9W9B42ofrUjpSTSjd2hSaqo4FkFy/tPIZVX/8sO8iKHH8zMn zNEUsBrwcX7oKgmPQ9U0FxvfuNgn0Qg4G8b9odDzxnkMsRoB0WArtA==9cFm -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Turnbull <james@lovedthanlost.net> writes:> seph wrote: >> Hi all. My particular environment doesn''t allow most of the machines to >> make direct external connections, so I send a lot of things through >> proxies. And now, I''m trying to figure out how to use puppet to install >> gems, via proxy. > > John Ferlito has a patch for this - inline:Yeah, I really don''t want to patch puppet. (It''s harder for me to maintain local patches for future upgrades). Is this something that will make it upstream? My current solution is to write out a ~root/.gemrc, not that nice but fits in my framework. seph -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Peter Meier
2010-Jan-08 18:18 UTC
Re: [Puppet Users] Re: Install gem packages behind a proxy
> Yeah, I really don''t want to patch puppet. (It''s harder for me to > maintain local patches for future upgrades). Is this something that will > make it upstream?well if a ticket is opened about the issue, the patch is sent to the -dev list and get accepted it will make it upstream. but somebody has to do that process. cheers pete -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.