[Puppet-dev] Order dependent behaviour of variables
David Schmitt
david at schmitt.edv-bus.at
Sat Jul 14 04:56:41 CDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi *!
After tracking down why some of my node-level variables where not propagated
to the included classes, I could distill my problem into the following
testcase:
david at zion:~/tmp$ cat test.pp
$var1 = "var1"
err("$var1:$var2")
exec { "/bin/echo top:$var1:$var2": }
class muh { exec { "/bin/echo muh:$var1:$var2": } }
include muh
$var2 = "var2"
err("$var1:$var2")
david at zion:~/tmp$ puppet test.pp
err: main[top]: var1:
err: main[top]: var1:var2
notice: //muh/Exec[/bin/echo muh:var1:]/returns: executed successfully
notice: //Exec[/bin/echo top:var1:var2]/returns: executed successfully
david at zion:~/tmp$
As far as I understand the intended behaviour[1] of variables, both Execs and
both functions should see both $var1 and $var2. As can be seen from the
example, this is not the case with (at least) puppet 0.23.0-1 from
Debian/unstable.
Am I wrong about how puppet should behave or should I file a bug about that?
Can anybody else reproduce/test this? Possibly on other puppet versions?
Regards, David
[1] From LanguageTutorial: "The primary difference is that you cannot change
the value of a variable within a single scope, _because_that_would_rely_on
file_order_to_determine_the_value_of_the_variable." (emphasis mine)
- --
- - hallo... wie gehts heute?
- - *hust* gut *rotz* *keuch*
- - gott sei dank kommunizieren wir über ein septisches medium ;)
-- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGmJ3d/Pp1N6Uzh0URAs8sAJ4tf1RUjA31vfAGeYQSNGjtI8ZPAgCeP9JC
vWJB5cLEg/7ugUMzQhWOF/I=
=uiE6
-----END PGP SIGNATURE-----
More information about the Puppet-dev
mailing list