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

Not clear where the ipaddress gem should be installed #152

Closed
robinbowes opened this issue Apr 3, 2016 · 9 comments
Closed

Not clear where the ipaddress gem should be installed #152

robinbowes opened this issue Apr 3, 2016 · 9 comments

Comments

@robinbowes
Copy link

Following on from #128...

I think you need to be clearer about where the ipaddress gem should be installed.

We're using PE 3.8.x with pe-puppetserver on the master, and I fixed the "could not autoload" issue by installing the ipaddress gem into the puppetserver environment, ie:

puppetserver gem install --no-ri --no-rdoc ipaddress

Is it actually required on the client as well? Or only the server?

@rski
Copy link
Member

rski commented Apr 3, 2016

I think only installed it on the clients. It has been a long time since that so I can't really remember, I'll take a look tomorrow. I haven't worked with PE/PS at all so I can't really help with that, sorry.

@robinbowes
Copy link
Author

From my testing, it also need to be installed into the puppetserver ruby, as described above.

@rski
Copy link
Member

rski commented Apr 4, 2016

locate ipaddr | grep gem returns something like /usr/local/share/gems/gems/ipaddress-0.8.0 so it does seem to be installed on our master. To be honest, I can't find good documentation on providers depending on gems.
Maybe confining the feature will help and the gem won't be required on the master. It seems this will also make having puppet install the gem with

 package { 'ipaddr':
    ensure => 'installed',
    provider => gem,
  }

possible instead of having to do it some other way before the puppet run.

@jyaworski
Copy link
Member

There is a parser function, so it looks like we need to be clear that it's required on both the clients and the servers.

@vholer
Copy link
Contributor

vholer commented May 19, 2016

I think the dependency on external library you have to install on all clients is very unfortunate. I had to hack this by adding dirty fake Facter code, which installs the library before serious Puppet functionality is executed:

facter/fix_packages.rb:

if Facter.value(:osfamily ) == 'RedHat' then
  Facter::Core::Execution.exec(<<-EOS)
rpm -q rubygem-ipaddress ||
  yum -y install rubygem-ipaddress
EOS

elsif Facter.value(:osfamily) == 'Debian' then
  Facter::Core::Execution.exec(<<-EOS)
dpkg -l ruby-ipaddress ||
  apt-get install -y ruby-ipaddress
EOS
end

Isn't it possible (and better) to embed the ipaddress into module's lib/ directory? Thanks.

@tuxmea
Copy link
Member

tuxmea commented May 19, 2016

We had a similar issue with a type and provider. We decided to confine the provider.
If you really want to hack in the installation in this way I would not go for OS specific installations but use puppet resource package instead.
This will prevent OS specific code.

@vholer
Copy link
Contributor

vholer commented May 19, 2016

You are right, on the other hand it takes more time to check and install via puppet resource:

  • rpm/yum: check - 0.02s, check&install - 2.2s
  • puppet: check - 1.2s, check&install - 3.7s

... and these are best measured time, usually was a more higher.

But that's not important right now. I just wanted to ask if there are any plans to fix this inside the module (either by installing or including the library) or disabling type/provider if required library is not installed. So that the system administrator doesn't have to fix all the machines theirself.

@rski
Copy link
Member

rski commented May 19, 2016

@vholer ideally this will be done someday soon and a new version of puppet-network will be released to the forge. Then you'll just have to add include network somewhere in your manifest and things will work.

@vholer
Copy link
Contributor

vholer commented May 20, 2016

@rski Thank you.

rski added a commit to rski/puppet-network that referenced this issue Jun 26, 2016
The README now mentions the network class and how to use it. It also explains that the ipaddress gem should be installed both on the master and clients, which should address voxpupuli#152.
@igalic igalic closed this as completed in df1af79 Sep 2, 2016
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

No branches or pull requests

5 participants