-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > it was because the case > > $mysql_enabled = 1 > class mysql::server { > service{mysqld: blablabla activate} > } > > class stripdown{ > if $mysql_enabled == 1 { > service{mysqld: blablabla deactivate} > } > } > > node somenode { > include mysql::server > include stripdown > } > > So you see in the case above, the parser will fail because service > [mysql] is included and defined twice (of course, since it is grammar > parser and not an AI ;-). But it would have worked if executed > ( But i know the whole thing with variables is maybe a wrong > implementation of the problem )
why don't you include a stripped down mysql class instead of defining the service twice? I don't get it: $mysql_enabled = 1 class mysql::stripdown { service{mysqld: blablabla deactivate} } class mysql::server inherits mysql::stripdown{ Service[mysqld]{ blablabla activate} } class stripdown{ if $mysql_enabled == 1 { include mysql::stripdown } } node somenode { include mysql::server include stripdown } but I don't like this $mysql_enable at all, in your productive setup is it a fact or do you set the variable? cheers pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAksrUzMACgkQbwltcAfKi39/rQCcC9sRnnfrgmqH4uKAPZu1iYlh bnMAn3tc2KsZDGgA9uWDBw3GrdwriYHy =NuYW -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.