Rpm install using foreman & puppet

> Hi,
>
> I have created a puppet class for installing a rpm file…but it does not
> work…could you direct me what the problem is…
>
> init.pp
> class mcafee-rpm {

Note that hyphens aren't permitted in class names, this can cause
strange issues, possibly including the one you're seeing:

http://docs.puppetlabs.com/puppet/latest/reference/lang_reserved.html#classes-and-types

> package { "uvscan":
> provider => 'rpm',
> ensure => installed,
> source =>
> 'http://server1.local/packages/mcafee/uvscan-6.0.3.356-1.0.el6.x86_64.rpm',
>
> }
> }
>
> I can install the rpm using
> rpm -Uvh
> http://server1.local/packages/mcafee/uvscan-6.0.3.356-1.0.el6.x86_64.rpm
>
> when using puppet agent
>
> Error: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not find class mcafee-rpm for server21.local on node
> server21.local
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run

Puppet's unable to find your init.pp file, perhaps it's in the wrong
directory.

It should be in
/etc/puppet/modules/production/mcafee-rpm/manifests/init.pp or similar
(again, rename the module and class without hyphen).

http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html

··· On 01/03/13 14:38, Binoy Daniel wrote:


Dominic Cleal
Red Hat Engineering

Hi Dominic,

Thanks for the quick response…it works well…

Thanks
Daniel

··· On Friday, 1 March 2013 14:46:26 UTC, Dominic Cleal wrote: > > On 01/03/13 14:38, Binoy Daniel wrote: > > Hi, > > > > I have created a puppet class for installing a rpm file..but it does not > > work..could you direct me what the problem is.. > > > > init.pp > > class mcafee-rpm { > > Note that hyphens aren't permitted in class names, this can cause > strange issues, possibly including the one you're seeing: > > > http://docs.puppetlabs.com/puppet/latest/reference/lang_reserved.html#classes-and-types > > > package { "uvscan": > > provider => 'rpm', > > ensure => installed, > > source => > > ' > http://server1.local/packages/mcafee/uvscan-6.0.3.356-1.0.el6.x86_64.rpm', > > > > > } > > } > > > > I can install the rpm using > > rpm -Uvh > > http://server1.local/packages/mcafee/uvscan-6.0.3.356-1.0.el6.x86_64.rpm > > > > when using puppet agent > > > > Error: Could not retrieve catalog from remote server: Error 400 on > > SERVER: Could not find class mcafee-rpm for server21.local on node > > server21.local > > Warning: Not using cache on failed catalog > > Error: Could not retrieve catalog; skipping run > > Puppet's unable to find your init.pp file, perhaps it's in the wrong > directory. > > It should be in > /etc/puppet/modules/production/mcafee-rpm/manifests/init.pp or similar > (again, rename the module and class without hyphen). > > http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html > > -- > Dominic Cleal > Red Hat Engineering >