puppet-php icon indicating copy to clipboard operation
puppet-php copied to clipboard

Unable to set some private class parameters via resource-like declaration

Open thatgraemeguy opened this issue 4 years ago • 2 comments

One of the key tenets of the roles and profiles design pattern is that profile classes (which folks like me write for our various environments) should set all parameters on all the component modules they make use of (such as this one), and that component modules should not get any of their data through Hiera lookup.

Here's an excerpt from the "rules" for profile classes (bold added by me for emphasis):

Profiles own all the class parameters for their component classes. If the profile omits one, that means you definitely want the default value; the component class shouldn't use a value from Hiera data. If you need to set a class parameter that was omitted previously, refactor the profile.

In some instances this simply isn't possible, for example php::fpm::config contains a number of parameters which cannot be set except via Hiera data, e.g. $settings, $pool_purge, etc.

There should be a way to set these when using the main php class via a resource-like declaration, as one would do in a profile class.

thatgraemeguy avatar May 19 '20 06:05 thatgraemeguy

How is this "done"? As an example, there is a parameter on the class php::fpm::config called 'process_control_timeout'. There is no way to provide a value for this parameter except via Hiera.

thatgraemeguy avatar Apr 14 '21 12:04 thatgraemeguy

Same here: process_max

mdklapwijk avatar Mar 10 '22 18:03 mdklapwijk