Scenario
RHEL < 5 do not include yum by default. Therefore, in order to use the yum provider with the package type, steps must be taken to "yummify" the client beforehand.
Attempted Solution
Wrote a class that performs the following tasks:
- Installs yum package and all dependencies using the rpm provider
- Configures client repo configs by using the yumrepo type
Wrote a second class to install nagios-nrpe package using the yum provider like so
class nagios_nrpe {
exec { "yum update":
refreshonly => true
}
# we'll need to ensure that yum update is run before attempting to install a package
package { nagios-nrpe:
ensure => installed,
provider => yum,
before => Exec["yum update"],
#require => Package[yum],
require => [ Yumrepo["247_ny_dag_${architecture}"], Yumrepo["247_ny_${lsbdistid}_${lsbdistrelease}_base"] ]
}
}
Result of first puppetd run
(yum package was uninstalled prior to running the test)
[root@admin4-ny testing]# puppetd --masterport=8141 --test
notice: Ignoring --listen on onetime run
notice: Ignoring cache
info: Caching configuration at /var/lib/puppet/localconfig.yaml
info: /Sshkey[admin4-ny]: Adding aliases "puppet"
err: Could not create nagios-nrpe: Parameter provider failed: Provider 'yum' is not functional on this platform
err: Parameter provider failed: Provider 'yum' is not functional on this platform
info: /File[/etc/httpd/conf.d/vhost-yum-repo.conf]: Adding aliases "vhost-conf"
notice: Starting configuration run
notice: //admin4-ny/yum_client_ny/yum_client_ny_redhat/Package[yum]/ensure: created
notice: Finished configuration run in 2.82 seconds
[root@admin4-ny testing]#
So yum gets installed.... ok
Now after running puppetd for the second time, the yum provider is available and nagios-nrpe gets installed.