Every time I look at this, I keep thinking about the way Debian implement 
"feature packages" or "virtual packages". The Debian packages "providing a 
feature", which can then be depended upon by other packages. Some package 
that requires a MTA shouldn't care if I use exim, postfix or sendmail, as 
long as I have some sort of MTA package installed. 

In my case, I have a number of classes that define auth mechanisms 
(mutually exclusive), and we have other classes that require "some sort of 
auth". 

We have systems with "nslcd" and some with "sssd". Both provide auth, and 
can't be installed together. We have other classes that handles what those 
needs (setup kerberos and what not, for each of those). But then in other 
classes, we need to make sure we have "some" auth, and maybe a way to 
figure out which...

I'm looking at this point at combining the two classes into a "meta class" 
that takes a parameter, and allows me to setup all those things that 
depends on auth automagically in one class, but I keep thinking that i'm 
killing reusability at that point. (my magic "auth" class becomes way too 
specific to be shared)

What I would be after is the ability to have a module "masquerade" as a 
different name. so I can say "require auth" in some moduleA, and have 
ModuleAuth1 and ModuleAuth2 both say "I can provide "auth", and let the 
manager/user of the system define which one they want. 

I wish classes had the ability to do something like:

.../modules/sssd/manifests/init.pp:
class sssd as auth {
  # setup sssd auth here...
}

.../modules/nslcd/manifests/init.pp:
class nslcd as auth {
  # setup nslcd auth here ...
}

.../modules/ssh_authz/manifests/init.pp:
class ssh_authz {
  # something as simple as:
  require auth 
  # that would be difficult to "reconcile" the class name in the parser

  # or something like:
  require Feature['auth']
  # which would explicitly make this class "get me one of those" to be
  # resolved maybe later... but still enforce the dependency...
}

With something like that, you can have someone manage a box with one of the 
two first classes, and use the third one without having to "care" which 
scenario they have. If the first two are both included, that's obviously a 
problem, and can be easily detected (two classes are providing "auth"). if 
none are included, then a resource is missing. 

Now, all that being said, I have absolutely no knowledge of the way the 
parser works internally, so this could be very silly, and completely off 
the realm of possibilities...

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/51e53940-c0c0-4ced-b75f-f7d34e051023%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to