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

Open
#578 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
devops

Research direction

Start by tracing how the main php class declares php::fpm::config and how parameters such as settings and pool_purge are currently supplied through Hiera. Define how a resource-like declaration should set those parameters directly, then verify that the profile can override them without relying on Hiera data.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Puppet
Stars
86
Forks
264
Avg merge
29m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from voxpupuli/puppet-php

All issues in voxpupuli/puppet-php

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.