CFE-4450: Allow passing environment variables to package managers
Allow passing options to the package managers modules through env:NAME=VERSION options.
Taking the easiest path. If it is considered acceptable I'll add a test case and documentation.
Do you have some explicit examples of the use case for each of the package managers as well?
For APT, for example controling needrestart's behavior.
But the main use case is for non-standard packages that allow customizing the configuration through env vars used in the postinst script. GitLab is one of them (https://docs.gitlab.com/omnibus/installation/index.html#set-up-the-initial-account):
sudo GITLAB_ROOT_EMAIL="<[email protected]>" GITLAB_ROOT_PASSWORD="<strongpassword>" EXTERNAL_URL="http://gitlab.example.com" apt install gitlab-ee
From my side I think it makes sense, I will invite @olehermanse @craigcomstock to bike shed a bit.
I created some basic documentation in https://github.com/cfengine/documentation/pull/3374. I also took a look at the tests but it seems there are no tests covering the options attribute, and that there is no testing mechanism for "real module/fake package manager" that would be convenient here (there is "fake module/no PM" and "real module/real PM"). I'll try to take a closer look.