-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Use Case
Some 3rd party packages require that during installation some environment variables are set.
A common example would be opensearch which requires to have set OPENSEARCH_INITIAL_ADMIN_PASSWORD that the package installation does not fail.
https://docs.opensearch.org/latest/install-and-configure/install-opensearch/debian/#install-opensearch-from-a-package
Another example would be percona where you can disable telemetry by setting an environment variable:
https://docs.percona.com/percona-server/innovation-release/telemetry.html#get-expert-help
Describe the solution you would like
The ideal solution would be if the package resource would support passing environment variables.
package { 'opensearch':
ensure => 'present',
environment => [
"OPENSEARCH_INITIAL_ADMIN_PASSWORD=${password}",
],
}
Implementation should most likely be the same like in the exec resource where it's already possible to pass environment variables:
https://help.puppet.com/core/8/Content/PuppetCore/Markdown/exec.htm?Highlight=exec#exec-attribute-environment
Describe alternatives you've considered
We currently use exec as an alternative but it requires quiet some more knowledge and is not plattform independent code.
See: voxpupuli/puppet-opensearch#71
Additional context
No response