Issue #7928 has been updated by Felix Frank.
This came up on the mailing list again today, causing me to rethink the issue.
This is what I came up with:
Basically, if you want your defined type to behave like classes wrt.
meta parameters, you need to add them to each resource in your defined
type like this:
<pre>
define aaaa () {
file { '/etc/slapd.d/define':
ensure => file,
content => 'define',
require => $require,
before => $before,
notify => $notify,
...
}
}
</pre>
It's highly impractical, but on the other hand, if puppet were to include these
automatically, this would raise other questions such as
* what if I want a specific resource to *not* respect the global require
* how are additional metaparameters of inner resources treated
etc.
Worst thing is, I guess, that changing how this works will break existing
manifests, so I think we'll have to learn to deal.
----------------------------------------
Bug #7928: Metaparameters are not expanded to resources inside defines
https://projects.puppetlabs.com/issues/7928#change-65007
Author: Felix Frank
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category:
Target version:
Affected Puppet version:
Keywords: metaparameter, define, schedule, loglevel
Branch:
This is apparently a 2.6 regression. Consider the following manifest:
<pre>
define my_notify() { notify { $name: }}
schedule { "not-ever": period => "never" }
class schedule_test {
notify { "not supposed": schedule => "not-ever" }
my_notify { "not supposed either": schedule => "not-ever" }
}
class loglevel_test {
notify { "invisible": loglevel => "debug" }
my_notify { "invisible too": loglevel => "debug" }
}
include schedule_test
include loglevel_test
</pre>
It's not supposed to generate any notifies, ever, which holds true for 0.25.5.
With 2.6.8, it consistently displays both the wrapped notifies.
--
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.