-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
pass options through env_vars if no control over init files #530
Conversation
834f599
to
809b5bb
Compare
okay, now that #529 is fixed, i think this is more ready for review, and a good replacement for the even more hackish #528. now we don't allow env_vars (which don't really do anything in most cases) and instead use them to pass options only in some narrow use cases (init_style=none and install_method=package). as others (@ekohl) have said, this might be better refactored so that we drop support for upstart and sysv style inits, so that the code paths are clearer here. but in the meantime, this is a good stopgap measure to make it possible to run this module against debian package installs (#32). |
For some reason, the node exporter unit test checks for the inexistence of the bird_exporter config file. Naturally, it doesn't find it (why would it?). I suspect this is an artifact of a copy-paste from the bird exporter, and what was really meant here was to check for the inexistence of the node exporter config file.
The logic here is that if init_style is non, then we have no control over the init files themselves *except* through the environment file. Typically, the way this works is there is a ARGS environment variable that gets sucked into the systemd unit file (or the sysv init file).
The previous version of this code left the file lying around if the env_vars values were emptied. Proper practice should make sure that file is garbage-collected if unmanaged.
For some reason, the bird exporter thinks that file should be created even though it doesn't use init_style=none or install_method=package. Sure, it does have default options, but it seems that should normally not get triggered with default parameters.
3e555a4
to
e04a233
Compare
i'm at a loss as to why those tests fail. those env_file should not be created, normally, because those hosts don't have init_style=none... so any ideas here would be welcome. |
This should make sure we don't create the env files when the env is empty.
#531 was merged in here to facilitate debugging tests. |
this is necessary now that voxpupuli#531 has been merged in
pass options through env_vars if no control over init files
The logic here is that if init_style is non, then we have no control
over the init files themselves except through the environment
file.
Typically, the way this works is there is a ARGS environment variable
that gets sucked into the systemd unit file (or the sysv init file).
followup to #32, replacement for #528, based on top of #529