On Jun 1, 5:34 am, Rufus McDufus <r...@bamalam.com> wrote:
> Hi folks - I'm trying what should be a simple task but I'm having a case of
> brain fade!  In puppet enterprise in the pe_compliance module, a cronjob
> gets added by class pe_compliance::agent:
>
> % cat /opt/puppet/share/puppet/modules/pe_compliance/manifests/agent.pp
> class pe_compliance::agent {
>   cron { 'report_baseline':
>     command     =>
> 'PATH=/opt/puppet/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin
> /opt/puppet/bin/puppet inspect',
>     hour        => '20',
>     minute      => '0',
>   }
>
> }
>
> I want to modify this cronjob to redirect stdout to /dev/null but I don't
> want to edit this file directly as I don't want to modify core modules.
> Everything I try to try and override results in a duplicate definition of
> Pe_compliance::agent or 'Only subclasses can override parameters'.  For
> instance if I try:
>
>   class pe_compliance::agent::cronmodify inherits ::pe_compliance::agent {
>     Cron['report_baseline'] {
>       command =>
> 'PATH=/opt/puppet/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin
> /opt/puppet/bin/puppet inspect >/dev/null'
>     }
>   }
>   include pe_compliance::agent::cronmodify
>
> I get:
>  Error 400 on SERVER: Duplicate declaration: Class[Pe_compliance::Agent] is
> already declared; cannot redeclare at
> /opt/puppet/share/puppet/modules/pe_compliance/manifests/init.pp:15
>
> Is there an easy way of overriding this parameter?


What you wrote above looks like it ought to work.  Perhaps Puppet is
handling the "::pe_compliance::agent" inconsistently.  Does it work if
instead you write

class pe_compliance::agent::cronmodify inherits pe_compliance::agent {
[...]

?

If it does, then I'm sure Puppetlabs would appreciate an official bug
report.  Given that Puppet accepts "inherits ::pe_compliance::agent"
in the first place, it should recognize that it refers to the same
class as "pe_compliance::agent", and therefore engage its machinery
that allows super- and subclasses to both be declared on the same
node.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
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