Add Data Types and remove deprecated parameters#406
Add Data Types and remove deprecated parameters#406bastelfreak merged 4 commits intovoxpupuli:masterfrom wyardley:data_types
Conversation
| 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.
Some use false. Do we have any convention in voxpupuli?
There was a problem hiding this comment.
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.
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.
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.
| 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.
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.
Maybe replace the anchor as well with a contain?
There was a problem hiding this comment.
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.
| } | ||
| if $keyfile and $key { | ||
| validate_string($key) | ||
| validate_re($key,'.{6}') |
There was a problem hiding this comment.
Does this mean it should be String[6] or String[6, 6]?
There was a problem hiding this comment.
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.
Yeah, I think String[6] will do it. Updated.
| class {'::mongodb::client': } -> | ||
| class {'::mongodb::server': } | ||
| class {'mongodb::client': } -> | ||
| class {'mongodb::server': } |
There was a problem hiding this comment.
can you move the arrow to the next line?
| class {'::mongodb::server': }-> | ||
| class {'::mongodb::client': } | ||
| class {'mongodb::server': }-> | ||
| class {'mongodb::client': } |
There was a problem hiding this comment.
can you move the arrow to the next line?
| class {'::mongodb::server': }-> | ||
| class {'::mongodb::client': } | ||
| class {'mongodb::server': }-> | ||
| class {'mongodb::client': } |
| 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.
Having a boolean here looks interesting
There was a problem hiding this comment.
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.
One option is Variant[Enum[''], Stdlib::Absolutepath] (or 'unmanaged'). These are times I miss the explicit null rather than undef.
| 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.
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.