-
-
Notifications
You must be signed in to change notification settings - Fork 451
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 Data Types and remove deprecated parameters #406
Conversation
| @@ -9,10 +9,10 @@ | |||
| # is repository dependent. | |||
| # | |||
| class mongodb::client ( | |||
| $ensure = $mongodb::params::package_ensure_client, | |||
| $package_name = $mongodb::params::client_package_name, | |||
| Variant[Boolean, String] $ensure = $mongodb::params::package_ensure_client, | |||
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.
Boolean?
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.
Some use false. Do we have any convention in voxpupuli?
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 based this on params - package_ensure_client has both $version and true. This module uses some weird patterns. I think we may want to try and fix some of the weird design decisions (though some of them would require major structural work), but for this pass, I'm just trying to keep things working.
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.
Boolean looks really wrong here. But as a first step we should keep the current behavior to make a migration to datatypes easier.
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.
Here's where it's used https://github.com/voxpupuli/puppet-mongodb/blob/master/manifests/params.pp#L45-L61
I think this is also causing some quirks when installing versions, because of vendor release tags etc.
| @@ -9,10 +9,10 @@ | |||
| # is repository dependent. | |||
| # | |||
| class mongodb::client ( | |||
| $ensure = $mongodb::params::package_ensure_client, | |||
| $package_name = $mongodb::params::client_package_name, | |||
| Variant[Boolean, String] $ensure = $mongodb::params::package_ensure_client, | |||
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.
Some use false. Do we have any convention in voxpupuli?
| anchor { '::mongodb::client::start': } | ||
| -> class { '::mongodb::client::install': } | ||
| -> anchor { '::mongodb::client::end': } | ||
| anchor { 'mongodb::client::start': } |
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.
Maybe replace the anchor as well with a contain?
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.
Yeah, I want to do the structural changes in another PR (if you want to start working on one, that would be great). But might be good to get the acceptance tests in a better place first? Right now they're a total disaster, maybe worse than when we started.
manifests/server/config.pp
Outdated
| @@ -89,7 +85,6 @@ | |||
| $noauth = true | |||
| } | |||
| if $keyfile and $key { | |||
| validate_string($key) | |||
| validate_re($key,'.{6}') | |||
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.
Does this mean it should be String[6] or String[6, 6]?
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 think the key is longer than 6 characters, so maybe 6,? I didn't know you could specify the length of the string that way, but that makes sense, can work on replacing this one too.
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.
Yeah, I think String[6] will do it. Updated.
README.md
Outdated
| class {'::mongodb::client': } -> | ||
| class {'::mongodb::server': } | ||
| class {'mongodb::client': } -> | ||
| class {'mongodb::server': } |
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.
can you move the arrow to the next line?
README.md
Outdated
| class {'::mongodb::server': }-> | ||
| class {'::mongodb::client': } | ||
| class {'mongodb::server': }-> | ||
| class {'mongodb::client': } |
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.
can you move the arrow to the next line?
README.md
Outdated
| class {'::mongodb::server': }-> | ||
| class {'::mongodb::client': } | ||
| class {'mongodb::server': }-> | ||
| class {'mongodb::client': } |
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.
please move the arrow
| String $package_name = $mongodb::params::mongos_package_name, | ||
| Optional[Stdlib::Absolutepath] $unixsocketprefix = $mongodb::params::mongos_unixsocketprefix, | ||
| Optional[Stdlib::Absolutepath] $pidfilepath = $mongodb::params::mongos_pidfilepath, | ||
| Optional[Variant[Boolean, Stdlib::Absolutepath]] $logpath = $mongodb::params::mongos_logpath, |
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.
Having a boolean here looks interesting
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 think it's needed because there are cases where there are defaults in certain cases (from params), but users need to be able to suppress them? So in that case, passing undef will get the default, but false will work to suppress it. This is a quirk of Puppet that I don't particularly like, but other than adding an additional boolean parameter, I don't know if there's an easy fix.
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.
One option is Variant[Enum[''], Stdlib::Absolutepath] (or 'unmanaged'). These are times I miss the explicit null rather than undef.
manifests/server.pp
Outdated
| Optional[String] $admin_password = undef, | ||
| Boolean $handle_creds = $mongodb::params::handle_creds, | ||
| Boolean $store_creds = $mongodb::params::store_creds, | ||
| Array $admin_roles = ['userAdmin', 'readWrite', 'dbAdmin', |
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 is really long. should we move the data to params.pp?
voxpupuli/puppet-mongodb#406 has implemented some backwards incompatible changes in data types. As we are in the process of removing mongodb in RDO during queens cycle, i think there is no point in fixing tripleo related manifest and we can pin it to the last commit before the breaking change. Change-Id: I115ce0daffbe99adb639f27e3a0eb93a43e4ab18
First pass, may need to make some adjustments still.
For now,
storage_engineis a string rather than enum, not sure if there's a small enough set of names to make this worth forcing.