No, i's not, it is correct, see http://docs.puppetlabs.com/guides/scope_and_puppet.html
At the moment you 'include mysql' only the top scope package variable is known, so there fore mysql package will be installed. swap them around and mysql-server package will get installed. class mysql_server { $package = 'mysql-server' include mysql } On Sunday, November 18, 2012 4:00:26 PM UTC+1, Walter Heck - OlinData.com wrote: > > I was playing around with scopes, and I noticed the following > behaviour, which strikes me as odd? This was done with Puppet > Enterprise 2.5.3 which is really Puppet 2.7.12. > I'm not sure what I would expect, quite likely an error message or at > the very least 'mysql-server' package gettign installed. Instead, it > just seems to choose the top-scope variable 'mysql' > > $package = 'mysql' > > class mysql { > package { $mysql_server::package: > ensure => present > } > } > > class mysql_server { > include mysql > $package = 'mysql-server' > } > > include mysql_server > > > This yields: > [root@master test]# puppet apply manifests/init.pp > notice: /Stage[main]/Mysql/Package[mysql]/ensure: created > notice: Finished catalog run in 6.25 seconds > > > cheers, > > -- > Walter Heck > CEO and Founder @ OlinData (http://olindata.com) > Puppet training and consulting > -- > Follow @olindata on Twitter and/or 'Like' our Facebook page at > http://www.facebook.com/olindata > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/l4d_ZijNdZsJ. To post to this group, send email to puppet-users@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.