Issue #5155 has been reported by Jordan Sissel.

----------------------------------------
Bug #5155: Exported custom defines aren't working.
https://projects.puppetlabs.com/issues/5155

Author: Jordan Sissel
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.6.2
Keywords: exported resources
Branch: 


The suggested fix for nagios_host and friends writing files owned by root and 
permission 600 is to use an additional file resource to manage the permissions. 
This makes me want to use a custom define to put the nagios_host and file 
resources in the same invocation.

However, under 2.6.2, at least, this seems not to work. Here's what I have - if 
I am missing something, let me know!

<pre>
define nagios::host() {
  nagios_host {
    "$name":
      target => "/etc/nagios3/conf.d/$name.cfg",
      use => "base-host",
      address => "$ipaddress_eth0",
      alias => "$name",
  }

  file {
    "/etc/nagios3/conf.d/$name.cfg":
      ensure => file,
      require => Nagios_host[$name],
      owner => nagios,
      mode => 644;
  }
}
</pre>

So then I would do this on each host:

<pre>
  @@nagios::host {
    $fqdn:
  }
</pre>

And then where I want the nagios config files:

<pre>
  Nagios::Host <<| |>>
</pre>

However, that results in an error:

<pre>
ops(~) % sudo puppet apply --storeconfigs fetch.pp
Exported resource Nagios::Host[frontend1.prod.example.com] cannot override 
local resource on node ops.prod.example.com



ops(~) % cat fetch.pp
define nagios::host() {
  nagios_host {
    "$name":
      target => "/etc/nagios3/conf.d/$name.cfg",
      use => "base-host",
      address => "$ipaddress_eth0",
      alias => "$name",
  }

  file {
    "/etc/nagios3/conf.d/$name.cfg":
      ensure => file,
      require => Nagios_host[$name],
      owner => nagios,
      mode => 644;
  }
}
 
Nagios::Host <<| |>>
</pre>

I think this is a bug in puppet, though I might be missing something.


-- 
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