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

Prefer Hiera data to params.pp #652

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Prefer Hiera data to params.pp #652

wants to merge 2 commits into from

Conversation

smortex
Copy link
Member

@smortex smortex commented Mar 21, 2023

This limit the quantity of spaghetti code we add when adding support for
another platform.

No functional change.

This limit the quantity of spaghetti code we add when adding support for
another platform.

No functional change.
python::gunicorn_package_name: 'gunicorn'
python::manage_pip_package: true
python::manage_venv_package: true
python::pip::group: 'root'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos to who can tell me what is wrong here: the default value is not catch by Automatic Parameter Lookup in spec/defines/pip_spec.rb. Setting an explicit value in the test suite or a default value in manifests/pip.pp for the $group parameter workaround the issue, but I don't get why it is not working as expected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, setting values for sub-classes of python is unusual (and maybe not supported?) but I would like to avoid breaking backwards compatibility in this PR.

I would expect Automatic Parameter Lookup to do exactly this, but it
does not.
@@ -0,0 +1,11 @@
---
python::version: '3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please keep the data in the init.pp instead common.yaml? That enables puppet-strings to pick it up and document it in the REFERENCE.md.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at https://voxpupuli.org/docs/reviewing_pr/, we have:

Are hiera yaml files added for data-in-modules? Ensure that the data is compatible with hiera 5. Static data that is equal across every supported operating system must stay in the init.pp, it shouldn’t be moved to a common.yaml due to puppet-strings issue #250.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These parameters in common.yaml have overrides in other data/**/*.yaml and should be os-dependent. They where previously documented as:

Default value: `$python::params::<foo>`

this line is not shown anymore. If we put the value in init.pp instead of common.yaml, wrong default values would be documented for some operating systems.

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.

2 participants