Issue #3758 has been updated by Jeff Weiss.
Confirmed this continues to behave the same on the `3.x` branch, though I
should note the aforementioned deprecation warning no longer shows.
Andrew, if you have a free moment (I know, I know), you may wish to take a look.
<code>
<pre>
class foo {
file { "/tmp/blub": }
}
class foo::overrides inherits foo {
File["/tmp/blub"] {
source => "/tmp/foo.$var"
}
}
node base_node {
include foo
}
node 'jweiss' inherits base_node {
$var = 'testing'
# include foo
include foo::overrides
}
</pre>
</code>
yields
<code>
<pre>
$ bin/puppet apply 3758.pp
Warning: No valid modulepath found, skipping pluginsync
Error: /Stage[main]/Foo/File[/tmp/blub]: Could not evaluate: Could not retrieve
information from environment production source(s) file:/tmp/foo.
Finished catalog run in 0.03 seconds
</pre>
</code>
whereas
<code>
<pre>
class foo {
file { "/tmp/blub": }
}
class foo::overrides inherits foo {
File["/tmp/blub"] {
source => "/tmp/foo.$var"
}
}
node base_node {
# include foo
}
node 'jweiss' inherits base_node {
$var = 'testing'
include foo
include foo::overrides
}
</pre>
</code>
yields
<code>
<pre>
$ bin/puppet apply 3758.pp
Warning: No valid modulepath found, skipping pluginsync
/Stage[main]/Foo/File[/tmp/blub]/ensure: defined content as
'{md5}d41d8cd98f00b204e9800998ecf8427e'
Finished catalog run in 0.06 seconds
</pre>
</code>
Relevant files:
<code>
<pre>
$ ls -la /tmp/fo*
-rw-r--r-- 1 jeff wheel 0 Jun 6 22:14 /tmp/foo.testing
jeff@jweiss:~/devel/puppetlabs/puppet (git:3.x+:aa82915)
ruby-1.8.7-p358@puppet-minimal
$
</pre>
</code>
----------------------------------------
Bug #3758: node inheritance locks scope
https://projects.puppetlabs.com/issues/3758#change-64506
Author: Kjetil Torgrim Homme
Status: Accepted
Priority: Normal
Assignee:
Category: parser
Target version:
Affected Puppet version: 0.25.4
Keywords:
Branch:
when a resource is defined via a class included in a parent node, the scope
seems to get fixed, and later overrides will not use the most recent scope.
class foo {
file { "/tmp/blub": }
}
class foo::overrides inherits foo {
File["/tmp/blub"] {
source => "puppet:///foo.$var"
}
}
node base_node {
include foo
}
node 'feh' inherits base_node {
$var = "testing"
include foo::overrides
}
"feh" is the name of my workstation. when I run the above code, it complains
about the file "foo." missing. if I move "include foo" into the feh node, I
get the expected error about "foo.testing" missing. setting $var in base_node
before "include foo" also works.
--
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.