On Mon, Feb 20, 2012 at 8:24 AM, Jos Houtman <j...@hyves.nl> wrote: > Hi group, > > I expect parameterized classes to behave simular to types in relation > to overrides, but obviously this is not the case. > Could someone what is should then expect from overriding an parameterized > class. > > what I have is: > > class dns(dns_servers) { > file{'/etc/resolv.conf': > content => template("dns/resolv.conf.erb") > } > } > > class role::init { > class{'dns': > dns_servers => ['10.100.100.1'] > } > } > > class role::loadbalancer inherits role { > Class['dns'] { > dns_servers => ['127.0.0.1'] > } > } > > node loadbalancer1 { > include role::loadbalancer > } > > I expected resolv.conf to have the 127.0.0.1 address, but it has the > 10.100.100.1 address. > > Could someone explain to me the rules around parameterized class inheritence. > And if using inheritence to override general use cases for very common > modules is not the way, should all this logic then be put into our > extlookup or something like hiera?
Parametrized classes do not behave like resources, so you can't override them in an inherited class. In your case, either do not inherit and declare the class separately, or declare include ntp, and change class definition to dns(dns_servers=hiera('dns_server')) {...} Thanks, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. 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.