Issue #4094 has been updated by Luke Kanies.

Status changed from Needs design decision to Accepted
Assigned to deleted (Luke Kanies)
Target version set to 0.25.6

Definitely looks like a problem, and I agree, it's an autoloading issue.

The infrastructure around this code has been completely rewritten in 2.6, so 
it'd be great if you could test this same feature in the beta when it comes out.
----------------------------------------
Bug #4094: Exported Resources cannot find exported customs defines in autoload 
path
http://projects.puppetlabs.com/issues/4094

Author: Peter Meier
Status: Accepted
Priority: Normal
Assigned to: 
Category: 
Target version: 0.25.6
Affected version: 0.25.5
Keywords: 
Branch: 


Given the following define:

<pre>
cat modules/nagios/manifest/plugin.pp
define nagios::plugin(
    $source = 'absent',
    $ensure = present
){
  file{$name:
    path => $hardwaremodel ? {
      'x86_64' => "/usr/lib64/nagios/plugins/$name",
      default => "/usr/lib/nagios/plugins/$name",
    },
    ensure => $ensure,
    source => $source ? {
      'absent' => "puppet://$server/modules/nagios/plugins/$name",
      default => "puppet://$server/modules/$source"
    },
    tag => 'nagios_plugin',
    require => Package['nagios-plugins'],
    owner => root, group => 0, mode => 0755;
  }
}
</pre>

which I export on nagiosclient with the following define:

<pre>
@@nagios::plugin{'foo': }
</pre>

and collect it on the nagios host with:

<pre>
Nagios::Plugin <<| |>>
</pre>

I get the following error message on the master:
<pre>
Tue Jun 29 06:26:41 +0200 2010 Puppet (err): Could not find resource type 
'Nagios::Plugin' on node nagioshost
</pre>

and on the client:

<pre>
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could 
not find resource type 'Nagios::Plugin' on node nagioshost
</pre>

However this fails only from time to time and actually it fails only if the 
nagiosclient exporting the define haven't yet run against the instance of the 
puppetmaster against which the nagioshost will run. I suspect that the 
autoloading of the @nagios::plugin@ isn't yet done on the failing instances and 
an exported resource doesn't trigger a lookup. This is not really a problem in 
a single-thread master environment (aka webrick), but it certainly becomes a 
problem on mongrel based installation and it can easily be reproduced by 
restarting a webrick based master and let nagioshost run prior to nagiosclient 
and it will fail as long as nagiosclient isn't yet run.

I worked around it by exporting the native resource file in the define and 
collecting files with a certain tag on the nagioshost. However, I think 
exporting such resources should be possible.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to