forked from debops/debops
-
Notifications
You must be signed in to change notification settings - Fork 1
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
[debops.NetBox] Add support for standby NetBox on read only PSQL database #13
Merged
k-304
merged 2 commits into
cloudscale-ch:cloudscale/stable-3.0
from
k-304:support-netbox-on-psql-cluster
Oct 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,22 @@ netbox__domain: '{{ ansible_domain }}' | |
|
||
# ]]] | ||
# ]]] | ||
# Primary/Standby configuration [[[ | ||
# ----------------------------- | ||
|
||
# .. envvar:: netbox__primary [[[ | ||
# | ||
# Boolean to define if the instance of NetBox will be primary or not. | ||
# True: This instance will become primary and needs read and write | ||
# database access. | ||
# False: This instance will become standby, | ||
# "netbox__config_maintenance_mode" will be set to True and | ||
# "netbox__config_session_file_path" will be populated. | ||
netbox__primary: True | ||
|
||
# ]]] | ||
# ]]] | ||
|
||
# APT packages [[[ | ||
# ---------------- | ||
|
||
|
@@ -660,7 +676,7 @@ netbox__config_base_path: '' | |
# | ||
# Enable or disable maintenance mode banner. | ||
# This overwrites potentially existing `dynamic configuration settings <https://netbox.readthedocs.io/en/stable/configuration/dynamic-settings/>`__. | ||
netbox__config_maintenance_mode: False | ||
netbox__config_maintenance_mode: '{{ not netbox__primary }}' | ||
|
||
# ]]] | ||
# .. envvar:: netbox__config_napalm_username [[[ | ||
|
@@ -833,7 +849,7 @@ netbox__config_metrics_enabled: False | |
# can be useful for enabling authentication on a standby instance with | ||
# read-only database access.) Note that the user as which NetBox runs must have | ||
# read and write permissions to this path. | ||
netbox__config_session_file_path: False | ||
netbox__config_session_file_path: '{{ "" if netbox__primary else netbox__data + "/sessions" }}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# ]]] | ||
# .. envvar:: netbox__config_media_root [[[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You should use the
bool
filter here to support all the boolean values commonly accepted by Ansible.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.
a94c915