-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does myapp have a module?
If it does, I would suggest the following: node foo { $myapp_ver = '123' include "myapp" } - - /etc/puppet/modules/myapp/manifests/init.pp - class myapp { import "ver/*.pp" } - - /etc/puppet/modules/myapp/manifests/ver/123.pp - if ( $myapp_ver == '123' ) { // Do the rest of the module } This keeps everything nicely logically separated. However, if you have a lot of versions with commonalities, you may want to use inherited classes off of 'myapp' and do something like the following in your node: $myapp_ver = '123' case $myapp_ver { '123': { include "myapp/123" } default: { include "myapp/base" } } Trevor On 01/10/2010 06:11 PM, Pete Emerson wrote: > Okay, here's a proposed solution, what do you think? > > In site.pp: > import "myapp/*/myapp.pp" > > In myapp/123/myapp.pp: > if ($myapp_config == '123') { > // recipes go here > } > > In this way, all different myapp.pp files get imported, but only the > rules inside the conditional for the desired version get executed. > > Still feels a bit hacky, but I think it will work. > > Pete > - -- Trevor Vaughan Vice President, Onyx Point, Inc. email: tvaug...@onyxpoint.com phone: 410-541-ONYX (6699) - -- This account not approved for unencrypted sensitive information -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAktKfNMACgkQyWMIJmxwHpTM3ACeLC/RiVLtCC60dJaaqHl7DT3B 3dIAoJi6B9yRtYcW2s7dN0RYHk7nvGwB =uyYs -----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.