Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Icinga2 Module uses incorrect paths #45867
Description of Issue/Question
Icinga2 changed the paths for certificates starting in version 2.8. The paths are hardcoded in the Icinga2 module, and refer to the paths for versions 2.7 and prior.
Suggestion to Fix
We could update the module and hardcode the new paths. However, this could break installs for old versions. In a perfect world, we'd be able to determine the paths automatically based on the version number.
Another option is to give the user control of the path (either create a different version of the module for the new versions, create a flag for the new paths, or an option to directly select the path). I'm not a fan of this option because it requires the user to micromanage the command/state as clients are upgraded (and is therefore no longer portable). This is especially problematic in a mixed environment.
I'm pretty comfortable doing the fixing, but I'm not sure what the best direction is. If we do want to autodetect the version, a canonical example of a different module that does it would be helpful for best practices.
This is an issue for the current version, and appears to still be an issue in Oxygen. As of the latest Oxygen commit in Github, the old paths were still hardcoded.
@Nick2253 Thanks for the report. The paths should definitely be configurable with defaults based one standard locations. If there is a way to determine the version of icinga2 installed, perhaps with a CLI argument to a binary, that would be one way to determine the appropriate default locations by version. And we would definitely welcome a PR with this fix. Thanks!
I'm working through the changes here, and I just had a quick question about best practices. I can get the version directly from the icinga binary, but I'm not sure where I should put the logic to get this version and determine the default paths. Should that go in the