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

Example for set_parameters #582

Open
CostelloC opened this issue Apr 21, 2020 · 5 comments
Open

Example for set_parameters #582

CostelloC opened this issue Apr 21, 2020 · 5 comments
Labels
needs-feedback Further information is requested

Comments

@CostelloC
Copy link

Can't seem to work out how to add an additional parameter under 'set_parameters'
set_parameter => 'authenticationMechanisms: SCRAM-SHA-1',
set_parameter => 'authenticationMechanisms= SCRAM-SHA-1',
Is there an example?

What are you seeing

setParameter is of type StringMap, but value in YAML config is not a map type

@dhoppe
Copy link
Member

dhoppe commented Apr 21, 2020

That depends on whether you use Hiera or the Puppet DSL.

Hiera:

mongodb::server::set_parameter: 'authenticationMechanisms=SCRAM-SHA-1'

Puppet:

class { ‘mongodb::server:
  set_parameter => 'authenticationMechanisms=SCRAM-SHA-1',
}

Please provide more infos, if this does not work. I never used this module. 🤓

@dhoppe dhoppe added the needs-feedback Further information is requested label Apr 21, 2020
@CostelloC
Copy link
Author

CostelloC commented Apr 22, 2020

Thanks @dhoppe, I'm using puppetDSL it looks like, this is the full class I use

-> class {'mongodb::server':
    ensure => present,
    port    => 27000,
    dbpath => '/data',
    dbpath_fix => true,
    logpath => '/log',
    verbose => true,
    storage_engine => 'wiredTiger',
    auth => true,
    set_parameter => 'authenticationMechanisms=SCRAM-SHA-1',
}

but I get the error
Option: setParameter is of type StringMap, but value in YAML config is not a map type
so then I also tried
set_parameter => 'authenticationMechanisms: SCRAM-SHA-1',

then I get
Error parsing YAML config file: yaml-cpp: error at line 36, column 38: illegal map value

@dhoppe
Copy link
Member

dhoppe commented Apr 22, 2020

I do not think that the error message is related to this Puppet module. It looks like a message from the mongoDB config validator.

According to the man pages of mongoDB, this parameter can only be set during the start-up:

I think this parameter needs to be added at /etc/sysconfig/mongod, which is not managed by this module.

@CostelloC
Copy link
Author

CostelloC commented Apr 22, 2020

I think it now works with this syntax-

    set_parameter => "
    authenticationMechanisms: SCRAM-SHA-1
    "

Puppet runs and mongo starts with no errors, but I need to test it out

@oniGino
Copy link

oniGino commented Jul 10, 2020

this is broken in the content_template
I fixed this by copying the current template and fixing it myself

class { '::mongodb::server':
    config_template => "${module_name}/${profile_name}/mongod.conf.erb", 
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants