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

Set default redhat dbpath to /var/lib/mongo #718

Merged

Conversation

h-haaks
Copy link
Contributor

@h-haaks h-haaks commented Mar 24, 2024

Pull Request (PR) description

Aligns the default dbpath with rpm package content.

RedHat and derivative users with existing deployments relying on the module default should explicitly set dbpath to the old default before upgrading the module.

This Pull Request (PR) fixes the following issues

Fixes #714

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

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

If a parameter default value is system-dependant, we should remove any default value from the manifest and only provide values from Hiera in order for the documentation not pointing to the wrong direction:

Stdlib::Absolutepath $dbpath = '/var/lib/mongodb',

If I understand correctly this is a backward-incompatible change?

@h-haaks
Copy link
Contributor Author

h-haaks commented Apr 2, 2024

If a parameter default value is system-dependant, we should remove any default value from the manifest and only provide values from Hiera in order for the documentation not pointing to the wrong direction

I fixed this for all but the mongodb::server::journal parameter.
This parameter is optinal and there is another nojournal parameter controlling the same parameter in mongod.conf ...

<% if @nojournal -%>
storage.journal.enabled: false
<% elsif @journal -%>
storage.journal.enabled: true
<% end -%>

@h-haaks
Copy link
Contributor Author

h-haaks commented Apr 2, 2024

If I understand correctly this is a backward-incompatible change?

You are absolutely right. Existing databases has to be moved manually or the folder renamed before running puppet with this change. Otherwise the module will create new empty databases in the new location.

Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

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

LGTM. Because it is a backwards incompatible change, maybe the first message of the PR could be adjusted to explicitly detail who is affected by the change (RedHat and derivative users) and what they should do when updating (mv /var/lib/mongodb /var/lib/mongo).

@h-haaks h-haaks merged commit 07db498 into voxpupuli:master Apr 3, 2024
24 checks passed
@h-haaks h-haaks deleted the rhel-fix-default-dbpath branch April 3, 2024 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default location for database files on RHEL variants is /var/lib/mongo
4 participants