-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
require 'ipaddress' breaks puppet runs #129
Comments
this is not quite possible and it is probably cleaner to just install the gem some other way |
this is rather annoying.. couldn't the gem be part of the module and used with ruby by using load with full path (by making puppet transfer the ipadress gem to some temp location.. just like puppetlabs-concat does f.ex.).. If this starts to be a trend for all modules, we'll constantly need to manually update all servers, install images etc.. :( |
dooh. it seems its only needed on the master.. then its no issue :) |
hmm. appearently it just moved the requirement of ipaddress to fail AFTER this: Could not prefetch network_config provider 'redhat': undefined method `each_with_object' for #<Array:.. when I commented the line causing that fail out - it complained on the client. Also.. how is this supposed to work with puppet agent.. which has a selfcontained ruby env? AFAIK the load method I suggested would be the only viable approach for that? the system won't necessarily have the same ruby versions and hence not a usable module. |
and btw. I installed it on my redhat 6 host (ruby 1.8) - and with ipaddress gem on BOTH master and agent.. it still fails (with above each_with_object) and if I mask that out.. it fails 👍 Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/network_config: no such file to load -- ipaddress on node |
@KlavsKlavsen looks like rhel6 ruby does not have the function each_with_object, which is a whole different issue. (1..1).each_with_object(1) |
irb(main):001:0> (1..1).each_with_object(1) Seems so. I'm not quite ready to switch to puppet agent (which has embedded ruby :) |
This is also affecting me, and I'm stuck with CentOS 6 Ruby for the near future. I might try code an alternative to each_with_object() just for Ruby 1.8.7. If anyone has other suggestions, let me know. |
@jyaworski my original issue is resolved, please do not reopen this. If people are affected by the lack of each_with_object() they should open a different issue. |
My apologies. |
This is a follow up to issue #128, as it turned out to be more complicated than I thought.
ipaddress
is a library that is not present by default, yet it is required bypuppet-network/lib/puppet/type/network_config.rb
. Most nodes will not have it by default.It would be nice if it could be installed with puppet using something like
package { 'ipaddress' : ensure => present, provider => gem, }
but puppet fails to create a catalog if ipaddress is not installed so it will never be possible to install it with a package resource.
As is, the workaround is to install ipaddress somehow prior to running puppet. This will break deployments and it certainly does so with mine.
A proposed solution is to rescue the
require 'ipaddress'
(and maybe import something non-breaking in its place). This should allow puppet to get past the catalog stage, making it possible to install the gem using a package resource. After this, I assume that when a network_config resource is defined, puppet will reload the network_config.rb file, importing ipaddress properly.I'll look into possibly submitting a pull request to fix this very soon.
The text was updated successfully, but these errors were encountered: