Install rubygem package in order to use with library

43 views
Skip to first unread message

Sergey V. Arlashin

unread,
Aug 21, 2012, 9:14:46 AM8/21/12
to puppet...@googlegroups.com
Hello!
I have a custom function which requires a ruby gem which I have in my deb-repository.
If the package is installed beforehand manually the function works well. But if I want to install the package with puppet I get the following error:

 out: Could not autoload zabbix_host: no such file to load -- rubix at /etc/puppet/modules/zabbix/manifests/init.pp:83 on node

the code looks like

  package { 'librubix-puppet-ruby1.8':
    ensure    => installed
  }
  zabbix_host { "${::fqdn}":
    ensure   => present,
    require  => Package['librubix-puppet-ruby1.8']
  }

So it seems Puppet tries to execute zabbix_host before having the package librubix-puppet-ruby1.8 installed.
Is it possible to get the package librubix-puppet-ruby1.8 installed before executing zabbix_host ?

Thank you.


Denmat

unread,
Aug 21, 2012, 5:07:50 PM8/21/12
to puppet...@googlegroups.com
Hi 

See inline:


On 21/08/2012, at 23:14, "Sergey V. Arlashin" <serg...@gmail.com> wrote:

Hello!
I have a custom function which requires a ruby gem which I have in my deb-repository.
If the package is installed beforehand manually the function works well. But if I want to install the package with puppet I get the following error:

 out: Could not autoload zabbix_host: no such file to load -- rubix at /etc/puppet/modules/zabbix/manifests/init.pp:83 on node

Where is rubix declared? What's on line  83 of your init.pp? 

the code looks like

  package { 'librubix-puppet-ruby1.8':
    ensure    => installed
  }
  zabbix_host { "${::fqdn}":
    ensure   => present,
    require  => Package['librubix-puppet-ruby1.8']
  }

So it seems Puppet tries to execute zabbix_host before having the package librubix-puppet-ruby1.8 installed.
Is it possible to get the package librubix-puppet-ruby1.8 installed before executing zabbix_host ?

Thank you.


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/8b6QBCyfQuUJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Sergey V. Arlashin

unread,
Aug 22, 2012, 9:58:49 AM8/22/12
to puppet...@googlegroups.com
Where is rubix declared?

modules/zabbix/lib/puppet/type/zabbix_host.rb:

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'rubix/lib')
require 'rubix'

require 'facter'

Puppet::Type.newtype(:zabbix_host) do
  @doc = "Manages zabbix hosts"

  self.debug "// Blah"

  ensurable

  newparam(:name) do
    desc ""

    isnamevar
  end

  newparam(:api_host) do
    desc "Zabbix server API"

    validate do |value|
      raise ArgumentError, "Void api_host parameter" if value.empty?
    end

  end
...
...

What's on line  83 of your init.pp? 

  zabbix_host { "${::fqdn}":
    ensure   => present,
    template => $zabbix_template,
    group    => 'Linux servers',
    api_host => $api_host,
    require  => Package['librubix-puppet-ruby1.8']
  }

Denmat

unread,
Aug 23, 2012, 4:12:28 AM8/23/12
to puppet...@googlegroups.com
Hi, 

Righto, not sure that load path is correct, if it is can you successfully load the rubix gem using ruby's irb?

Den
Reply all
Reply to author
Forward
0 new messages