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

Move params to classes and hiera; Align defaults with supported versions #712

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

h-haaks
Copy link
Contributor

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

Pull Request (PR) description

Removing params classes and setting os specific param values in hiera data.
Aligning defaults with the supported MongoDB version.
Breaking:
Removed lots of unnecessary global params
Debian family; mongod logfile name changed from mongodb.log to mongod.log

@@ -82,8 +82,6 @@
group => $group,
}

if ($logpath and $syslog) { fail('You cannot use syslog with logpath') }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reordered checks in template so logpath is just ignored if syslog is true

let(:pre_condition) do
'class { mongodb::globals:
manage_package => true
manage_package_repo => false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

manage_package is removed.
Breaking change?

# @param bind_ip
# This setting can be used to configure MonogDB process to bind to and listen for connections from applications on this address.
# If not specified, the module will use the default for your OS distro.
# Note: This value should be passed as an array.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the above is either client or server params. There is no need for them in globals.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change.

#
# @param manage_package
# wgether this module willm manage the mongoDB server package
Copy link
Contributor Author

@h-haaks h-haaks Mar 21, 2024

Choose a reason for hiding this comment

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

I removed this because I couldn't make any sense out of it.
It only controlled package naming.

@@ -159,6 +84,9 @@
use_enterprise_repo => $use_enterprise_repo,
repo_location => $repo_location,
proxy => $repo_proxy,
proxy_username => $proxy_username,
proxy_password => $proxy_password,
aptkey_options => $aptkey_options,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some missing params to the repo class.

@h-haaks h-haaks marked this pull request as ready for review March 21, 2024 19:24
@h-haaks
Copy link
Contributor Author

h-haaks commented Mar 21, 2024

@stevenpost do you have any feedback on this one?

Copy link
Contributor

@stevenpost stevenpost left a comment

Choose a reason for hiding this comment

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

Perhaps managing the repository can also be completely outside of the globals class?
While most users will need to add it explicitly, it seems the cleaner option to be, as it would allow us to get rid of this globals class. It will also make it more explicit to those users that they are using an additional repository, instead of having that magically enabled and they reading the docs as they run into issues with things like a proxy.

spec/classes/server_spec.rb Show resolved Hide resolved
# @param bind_ip
# This setting can be used to configure MonogDB process to bind to and listen for connections from applications on this address.
# If not specified, the module will use the default for your OS distro.
# Note: This value should be passed as an array.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change.

@h-haaks
Copy link
Contributor Author

h-haaks commented Mar 22, 2024

Perhaps managing the repository can also be completely outside of the globals class? While most users will need to add it explicitly, it seems the cleaner option to be, as it would allow us to get rid of this globals class. It will also make it more explicit to those users that they are using an additional repository, instead of having that magically enabled and they reading the docs as they run into issues with things like a proxy.

I do not think leaving the repo management loosely coupled like that is a good idea.
It breaks with the usage pattern of almost all other modules I have ever seen.

As I mentioned in the roadmap issue the only option to globals here is to add a mongodb class on top that manages repo, server and client.
I can do this in a separate PR.

@stevenpost
Copy link
Contributor

I do not think leaving the repo management loosely coupled like that is a good idea. It breaks with the usage pattern of almost all other modules I have ever seen.

As I mentioned in the roadmap issue the only option to globals here is to add a mongodb class on top that manages repo, server and client. I can do this in a separate PR.

Fair enough, what you propose is kind of how the elasticsearch module does it AFAIK, see https://forge.puppet.com/modules/puppet/elasticsearch/readme for details. By default the repo is managed, but this can be overridden.

@h-haaks
Copy link
Contributor Author

h-haaks commented Mar 22, 2024

Fair enough, what you propose is kind of how the elasticsearch module does it AFAIK, see https://forge.puppet.com/modules/puppet/elasticsearch/readme for details. By default the repo is managed, but this can be overridden.

Yes, something like that with params to manage the different components.

@h-haaks h-haaks mentioned this pull request Mar 22, 2024
@h-haaks h-haaks requested a review from witjoh March 23, 2024 00:05
@h-haaks
Copy link
Contributor Author

h-haaks commented Mar 23, 2024

@stevenpost and @witjoh is this ok to merge? I'll fix #714 when it's merged, and then start on a draft for the mogodb class.

@h-haaks h-haaks merged commit b6d3f5f into voxpupuli:master Mar 24, 2024
24 checks passed
@h-haaks h-haaks deleted the move-params-to-hiera branch March 24, 2024 20:16
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.

2 participants