How can I override/set parameters for base profiles from a role or another profile?
Assume an open source Puppet deployment using the roles and profiles paradigm and Heira (https://puppet.com/presentations/desi...)
Lets say I have a role module called 'roleapplicationX' which includes two profile modules - "profileoracleserver" and "profiletomcat".
Now also assume that all my systems, via the external node classifier, loads a series of base profile modules, such as "tuned" (a Red Hat tool for managing kernel settings). In this list of base profile modules is "profile_tuned".
The profile_tuned class defaults to a tuned system profile of 'virtual' if it finds that the system is virtual based on Facts.
What I want to be able to do is inside the "profileoracleserver" in some way signal or change "profiletuned" to use the oracle tuned profile. You can't redefine classes using 'resource-like' syntax, so I can't just change parameters to "profiletuned". Variables are actually constants, so a profile can't change an existing variable.
Heira doesn't solve this problem, although I'm told that it should, because including profileoracleserver cannot have any bearing on Heira. Heira is great at letting you change the functionality of classes/modules per-node, but I cannot find a way for 'role' modules to change what a profile module does, without every role having to define all of my base profiles. I'm told that an ENC should only ever set a 'role' for a node, and nothing else, and yet it seems pretty clear to me I also have to store configuration for a role in the node's heira configuration, so I have to change things in multiple places.
What I'd like to do is assign a role to a node and that should alter the base configuration as needed.
The only other option I can think of is a horrible "if not defined define the base profile module" hack where base profiles are only declared via resource-like syntax if a role doesn't define them (i.e. with specific parameters). I'm pretty sure Heira was created to avoid this, and yet it seems the only in-puppet-code option I can think of.
Any help and advice would be much appreciated.