-
Notifications
You must be signed in to change notification settings - Fork 93
Add prefix parameters #196
base: develop
Are you sure you want to change the base?
Add prefix parameters #196
Conversation
Updated the prefix paths based on my previous PR #189 to be more generic and separate from Windows support for a cleaner merge. |
46c46c7
to
4ac27c6
Compare
Looking good so far but I have three remarks before merging. 1:
It's cleaner to have it point to 2: 3: Keep those PR's coming! 👍 |
+1 to what @arioch says. |
$dirprefix = false, | ||
$etcprefix = false, | ||
$shareprefix = false, | ||
$varprefix = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want to mix types here. The usage of these variables is all strings, while the default here is boolean. I'd think that an empty string here would be more accurate.
Right, thanks for your feedback, I'll get right to adapting as the feedback here has told me to. |
4ac27c6
to
26083ee
Compare
I'll merge my commits if the update looks good enough. |
71c49d8
to
f49387f
Compare
I am at least missing a spec test for the variables. I'll look at that tomorrow. |
Maybe also replicace Other than that if you add the spec test it looks good to me. 👍 |
And @arioch, once this is merged, I assume that we will be on the lookout for any variables that reference the path without the prefix. True story? |
I'm guessing you mean in future PR's... if so you're absolutely right. |
Yes yes, I meant future PRs. |
109285d
to
21b4129
Compare
Like so. I could not resolve $dir_prefix in params. I moved the path resolving to its own class and all paths resolve correctly now with a test file. If this is not a good/accepted solution please advise how you would like it instead. If I didnt use "$dir_prefix", everything would fit in params.pp and all the used vars would be as suggested with ::icinga2::__dir / dir_prefix, instead of icinga2::paths::__dir / dir_prefix |
21b4129
to
f431357
Compare
The changes here look good to me. Why support both |
@xaque208 - The reason was to allow for setting up for a case where you compile icinga2 to use /opt/icinga2 with the dir_prefix, making sure then that config can be in /opt/icinga2/etc rather than /opt/icinga2/etc/icinga2. It would also set "good" paths for the other variables to some small effect for simplicity. It is trivial to remove the dir_prefix, and that would remove the need of the path class. |
f431357
to
c86aa54
Compare
I redid it without the dir_prefix, it only contains the directories directly in params now and is the simplest I can get it. I havent been able to find a way to test for variables in spec, so I can not at the moment test for the output of sbin_dir (which will be used for Windows) and share_dir. |
This work looks good to me. I think I'd still prefer that the use of |
The i2 variables will be used immediately after this commit is accepted in the Windows PR I have not submitted yet, waiting for this and the puppet_ssldir one. I'll remove them if one more says it shouldnt stay in this commit, since that can come in the Windows commit, though I saw some use in the i2* feature for one of the BSD's which is waiting on this commit to use what I assume is the config_dir parameter at least. |
c86aa54
to
dce0308
Compare
Like so, I think I solved it by changing out if with unless, so you can override on a per osfamily basis for the parameters you want to. If anything else, let me know! |
I'm still +1 on the changes. |
👍 (tested in my enviroment) |
@arioch - Anything more I should change? I'm on vacation this week to hopefully get this PR accepted and move on with the Windows support. |
dce0308
to
8b50ff5
Compare
Rebased on current develop! |
Prefix options for etc, var and share, alternatively a generic one for all called dirprefix that is used unless the more specific is used.