Example for set_parameters
CostelloC opened this issue · comments
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
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. 🤓
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
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.
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
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",
}