Skip to content
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

Conversation

k-304
Copy link

@k-304 k-304 commented Sep 4, 2023

Allows to only run specific tasks on the master node, and skip it on standby nodes which do only have read access to the PSQL cluster.

@k-304 k-304 changed the title Add support for standby NetBox on read only PSQL database [debops.NetBox] Add support for standby NetBox on read only PSQL database Sep 4, 2023
@gaudenz
Copy link

gaudenz commented Sep 7, 2023

Instead of using the group name I would prefer to do this with a variable netbox__primary which defaults to True and can be set in the inventory. I think this better matches the style of DebOps.

And the current implementation uses a group name which contains a -. These names are deprecated in Ansible.

@k-304
Copy link
Author

k-304 commented Sep 8, 2023

Instead of using the group name I would prefer to do this with a variable netbox__primary which defaults to True and can be set in the inventory. I think this better matches the style of DebOps.

And the current implementation uses a group name which contains a -. These names are deprecated in Ansible.

Updated in: a94c915

@k-304 k-304 force-pushed the support-netbox-on-psql-cluster branch from c2c566f to a94c915 Compare September 8, 2023 12:03
@@ -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" }}'
Copy link

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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 }}'
Copy link

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k-304 k-304 marked this pull request as ready for review October 11, 2023 07:35
@k-304 k-304 merged commit ce5148d into cloudscale-ch:cloudscale/stable-3.0 Oct 11, 2023
7 of 12 checks passed
@k-304 k-304 deleted the support-netbox-on-psql-cluster branch October 11, 2023 07:36
urscale pushed a commit that referenced this pull request May 29, 2024
Add support for standby NetBox on read only PSQL database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants