Conditional Role Configuration/More Flexible Variants


Currently it's limiting that conditional configuration must always be associated with a variant. There's e.g. no way to have a different list of httpd.modules for the dispatcher role based on the value of another parameter like enableSsl, httpd.version or distribution. The only way to model these kinds of differences is to have a separate variant with its own configuration, so you would have to create all kinds of permutation variants like no-ssl+ssl-debian-apache22 (actually we already have no-ssl+ssl variant which illustrates the problem).

I'm not sure how to best solve this, but a few random ideas are:

  1. Allow to define parameters conditionally based on other parameters

  2. Have some kind of "mix-in" variant that contributes certain configuration, i.e. a variant that is not mutually exclusive with all others but adds/modifies them

  3. Allow some inheritance between variants so that it would be easy to create combined variants like no-ssl+ssl without having to redundantly declare the configuration of the other variants.


Stefan Seifert
July 22, 2017, 1:37 AM

makes sense - another alternative:

  • 4. allow to define multiple variants to a single node with a concept of merging the configuration

Stefan Seifert
August 16, 2017, 12:24 AM

i've created a branch for this feature:

in this branch i allow to define multiple variants for each node/role, with a new parameter variants (list) instead of variant (string). the old parameter can be used as well for backwards compatibility.

if multiple variants define the same parameter, the first one in the list wins.

does this fulfill your needs?

Stefan Seifert
August 24, 2017, 2:06 AM




Martin Wehner




Fix versions