Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the class parameters and switch to proper containment #18

Merged
merged 4 commits into from
Mar 10, 2019
Merged

Improve the class parameters and switch to proper containment #18

merged 4 commits into from
Mar 10, 2019

Conversation

natemccurdy
Copy link
Contributor

This PR bundles up a few improvements that I noticed could be made:

  • The deprecated validate_ functions have been replaced with parameter data types.
  • Static parameter defaults have been moved from params.pp to init.pp. This makes it easier to see at a glance what a parameter's value will be without having to flip to a different file. The params class should really only be used to calculate things.
  • Updates the containment from the deprecated anchor pattern to using the contain function.
  • Minor whitespace inconsistency in metadata.json.

@geekix geekix merged commit 498adf9 into geekix:master Mar 10, 2019
@geekix
Copy link
Owner

geekix commented Mar 10, 2019

@natemccurdy thanks for the great work on this, I will release on new module version tomorrow.

@natemccurdy
Copy link
Contributor Author

@geekix Hi, thanks for reviewing and merging!

Regarding the static defaults in init.pp vs. params.pp:

That is a practice that I and others in the community have been moving to. It makes it easier and quicker for folks to see what a default value will be when they don't have to change to a different file.

It also helps to answer the question "is this default value going to change based on some factor"? Putting only the calculated values in params.pp, it signals to the user that only these values could change while the others will more than likely stay static.

It's also a pre-cursor to eventually moving to Hiera 5's module-level data if desired. The values in params.pp will be moved to OS-specific hierarchies and the values in init.pp could stay there or be moved to the common layer of the hierarchy.

@natemccurdy natemccurdy deleted the param_types branch March 11, 2019 16:55
@geekix
Copy link
Owner

geekix commented Mar 12, 2019

@natemccurdy thanks for the explanation, it makes sense. I have already release a new module version on the forge with your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants