2010-09-15 16:15, R.I.Pienaar wrote: > ----- "Marc Zampetti" <marc.zampe...@gmail.com> wrote: > >> The problem is that I'm trying to do just what you suggest. I have a >> single class that defines the package and a default version, or just >> installed. Then I have sub classes that try to override the version. >> So, the base class is my generic "apache" class, and has all the logic to >> install apache on the host and configure the basics. Then the child >> classes add the instance specific stuff. As part of that, I need to >> specify the version to use. > > Using my proposed solution, you don't need all these classes, just update > the data don't make more classes.
Just to make clear, your solution is to have Marc write define pkg($app) { $version = extlookup("pkg_${name}_${app}", "present") package { $name: ensure => $version; } } class app1 { pkg { "needed-package": app => "app1"; } # Needs version 10.17 } class app2 { pkg { "needed-package": app => "app2"; } # Needs version 10.17 } class app3 { pkg { "needed-package": app => "app3"; } # Needs version 10.23 } in his manifests, and then in a separate file (which extlookup() will look in) write something like: pkg_needed-package_app1,10.17 pkg_needed-package_app2,10.17 pkg_needed-package_app3,10.23 Right? But that doesn't help him, because if he includes app1 and app2 on the same node, he will get a conflict, even though they want the same version of "needed-package". You must have some more mechanism to resolve that, and the only one I can think of is to used defined(). /Bellman -- 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.