I'm currently trying to create icinga module and the icinga-web and 
icinga-idoutils-libdbi-mysql from rpmforge
store the initial sql file in version numbered 
directory(/usr/share/doc/icinga-web-1.7.2/~~~).

So, I try to determine the version number from the yum info like as below, 
but that repository installed after my yum module gets work done.
Is there any ways to fetching custom fact after some resources setuped or 
any smart way to do this?

icinga_version.rb
----
def get_redhat_icinga_version
  version = Facter::Util::Resolution.exec('yum info icinga |grep 
"^Version"')
  if match = /^Version\s*:\s*(\d+\.\d+\.\d+)$/.match(version)
    match[1]
  else
    nil # should be fail?
  end
end

Facter.add("icinga_version") do
  setcode do
    case Facter.value('osfamily')
      when 'RedHat'
        get_redhat_icinga_version()
      else
        nil # should be fail?
    end
  end
end
----

-- 
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/-/5Fg1Xu6ghSUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to