-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add support for accept/no_accept for instances. #176
Conversation
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.
A few suggestions. Can you try those?
@@ -93,6 +93,13 @@ vrrp_instance {{ name }} { | |||
{% if instance.dont_track_primary is defined and instance.dont_track_primary | bool %} | |||
dont_track_primary # Override VRRP RFC dont_track_primary default | |||
{% endif %} | |||
{% if instance.accept is defined and instance.accept | bool %} |
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 instance.accept is defined and instance.accept | bool %} | |
{% if instance.accept is defined %} |
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 way if the user doesn't define accept (the default), there is no change in the config file.
And if someone writes instance.accept false, would write no_accept appropriately.
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've not tested the alternative (nor do I have an objection to it) but I'd have thought that my if which is checking if accept is defined and a boolean wouldn't pass in the case of accept:
, thus not writing out accept
or no_accept
to the file.
@@ -93,6 +93,13 @@ vrrp_instance {{ name }} { | |||
{% if instance.dont_track_primary is defined and instance.dont_track_primary | bool %} | |||
dont_track_primary # Override VRRP RFC dont_track_primary default | |||
{% endif %} | |||
{% if instance.accept is defined and instance.accept | bool %} | |||
{% if instance.accept %} |
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 instance.accept %} | |
{% if instance.accept | bool %} |
evrardjp@d59c740 Credits to @naphta I implemented @evrardjp suggested changes.
Coming to this role wanting to implement the keepalived configuration offered by nginx plus and they have accept inside that configuration. Had a quick dig into the manpage and thought this should suffice.