-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
nixos/keepalived: Implemented vrrp-instance track scripts and track interfaces #39671
Conversation
@mbrgm care to review? |
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.
I am not using keepalived on NixOS right now, so I only did a code review without actual testing. See my comments for some minor points, otherwise LGTM and thank you! :-)
type = types.bool; | ||
default = false; | ||
description = '' | ||
Don't run scripts configured to be run as root if any part of the path. |
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.
This should be "Don't run scripts configured to be run as root if any part of the path is writable by a non-root user."
weight = mkOption { | ||
type = int; | ||
default = 0; | ||
description = "Following a failure, adjust the priority with this weight."; |
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.
I'd suggest "with" -> "by".
description = "Required number of failures for KO transition."; | ||
}; | ||
|
||
execUser = mkOption { |
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.
I too think that execUser
would be a better name for this parameter, but the keepalived.conf file uses user
. I wonder if it'd be better to stick as close to the original parameters as possible... would be happy to have your opinion on that.
description = "Name of user to run the script under."; | ||
}; | ||
|
||
execGroup = mkOption { |
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.
If we change execUser
-> user
, then this one should be called group
.
…rfaces. Tracking scripts in particular, cannot be included in extraOpts, because script declaration has to be above script usage in keepalived.conf. Changes are fully backward compatible.
d0f4ef8
to
41d4bd2
Compare
@mbrgm All of your suggestions have been incorporated in latest squash. :-) |
@GrahamcOfBorg eval |
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.
LGTM. Thanks!
Motivation for this change
It would be nice to be able to explicitly declare keepalived virtual IP healthcheck scripts and interfaces, in order for failover to make sense.
Furthermore; tracking scripts in particular, cannot be included with
keepalived.extraConfig
, because VRRP scripts must be declared above script usage in keepalived.conf , otherwise keepalived will complain with something like:See: http://www.askmrisp.com/2017/04/17/solved-keepalived-not-running-track_script/ for details.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)