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

Refactor mongos handling #509

Merged
merged 5 commits into from
Oct 20, 2018
Merged

Refactor mongos handling #509

merged 5 commits into from
Oct 20, 2018

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Oct 20, 2018

  • Remove mongos_ parameters from globals
  • Move mongos parameters to mongos::params
  • Get the variables in scope so the config renders
  • Refactor some coding styles

) inherits mongodb::params {
Variant[Boolean, String] $ensure = $mongodb::mongos::params::ensure,
Stdlib::Absolutepath $config = $mongodb::mongos::params::config,
Optional[String] $config_content = undef,
Copy link
Member

Choose a reason for hiding this comment

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

More datatypes \o/

This should work as well?

Suggested change
Optional[String] $config_content = undef,
Optional[String[1]] $config_content = undef,

@ekohl
Copy link
Member Author

ekohl commented Oct 20, 2018

Updated:

  • Tightened the String types
  • Corrected the pid for Debian
  • Added the defaults for config_content and config_template to params.pp

Stdlib::Absolutepath $config = $mongodb::mongos::params::config,
Optional[String[1]] $config_content = $mongodb::mongos::params::config_content,
Optional[String[1]] $config_template = $mongodb::mongos::params::config_template,
Variant[String, Array[String]] $configdb = $mongodb::mongos::params::configdb,
Copy link
Member

Choose a reason for hiding this comment

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

Can you use this here?

Suggested change
Variant[String, Array[String]] $configdb = $mongodb::mongos::params::configdb,
Variant[String[1], Array[String[1]]] $configdb = $mongodb::mongos::params::configdb,

@ekohl
Copy link
Member Author

ekohl commented Oct 20, 2018

Updated:

  • Stricter Strings on $configdb
  • Refactor ensure handling to allow purging

This now allows you to purge the package using $package_ensure.

We can assume $service_ensure only has either running or stopped as
value because of data types. We can use this to simplify our code.

hasstatus has been defaulting to true since 2.7.0.

Rename bind_ip_real to connect_ip to better state what it's used for.
@ekohl ekohl merged commit 4fad38c into voxpupuli:master Oct 20, 2018
@ekohl ekohl deleted the mongos-refactor branch October 20, 2018 19:07
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