----- "Thomas Bellman" <bell...@nsc.liu.se> wrote: > 2010-09-15 16:51, R.I.Pienaar wrote: > > > ----- "Thomas Bellman" <bell...@nsc.liu.se> wrote: > > > >> 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 > >> } > > > > no, you just write pkg{"needed-package": } once, and then configure > > extlookup to give different hosts different versions. > > Ah, I understand. > > But then you instead need to maintain the mapping between which apps > are installed on which nodes in two places: your manifest files, > where you write include statements, and the extlookup data file. I'm not > Marc, so I don't know his exact circumstances, but to me it sounds > messy and not very maintainable. Unless you generate both from a common > data source... (And for this purpose, an external nodes tool would > probably count as "generating" the manifest.)
yeah, I agree it might not be ideal for all uses, it's just an option to consider. I didn't read all of his thread. Trying to model complex relationships like this with classes is a nightmare you either need lots of inheritance that can be hard to read, debug and anticipate or you need big if/case logic. For my example use case I'd have to make a new 2.6 class and go about editing nodes in groups doing a whole lot of potentially error prone edits when all I really want is a short term way to do a staged upgrade -- 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.