From d18391bf3f0d9e6ca7afa04f0f9a1f83b1a8bea6 Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Sun, 19 Mar 2017 16:15:24 +0200 Subject: [PATCH 01/10] Rearrange init.d scripts into templates/init.d --- manifests/init.pp | 2 +- manifests/mongod.pp | 5 +---- manifests/mongos.pp | 7 +------ .../debian_mongod.conf.erb} | 0 .../debian_mongos.conf.erb} | 0 .../redhat_mongod.conf.erb} | 0 .../redhat_mongos.conf.erb} | 0 .../replacement_mongod.conf.erb} | 0 8 files changed, 3 insertions(+), 11 deletions(-) rename templates/{debian_mongod-init.conf.erb => init.d/debian_mongod.conf.erb} (100%) rename templates/{debian_mongos-init.conf.erb => init.d/debian_mongos.conf.erb} (100%) rename templates/{redhat_mongod-init.conf.erb => init.d/redhat_mongod.conf.erb} (100%) rename templates/{redhat_mongos-init.conf.erb => init.d/redhat_mongos.conf.erb} (100%) rename templates/{replacement_mongod-init.conf.erb => init.d/replacement_mongod.conf.erb} (100%) diff --git a/manifests/init.pp b/manifests/init.pp index 40a1d2e..f7c3a69 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -49,7 +49,7 @@ file { "/etc/init.d/${::mongodb::old_servicename}": ensure => file, - content => template("${module_name}/replacement_mongod-init.conf.erb"), + content => template("${module_name}/init.d/replacement_mongod.conf.erb"), require => Service[$::mongodb::old_servicename], mode => '0755', before => Anchor['mongodb::end'], diff --git a/manifests/mongod.pp b/manifests/mongod.pp index 083eadf..85b01af 100644 --- a/manifests/mongod.pp +++ b/manifests/mongod.pp @@ -29,10 +29,7 @@ require => Class['mongodb::install']; "/etc/init.d/mongod_${mongod_instance}": - content => $::osfamily ? { - debian => template('mongodb/debian_mongod-init.conf.erb'), - redhat => template('mongodb/redhat_mongod-init.conf.erb'), - }, + content => template("mongodb/init.d/${::osfamily}_mongod.conf.erb"), mode => '0755', require => Class['mongodb::install'], } diff --git a/manifests/mongos.pp b/manifests/mongos.pp index 2926bdf..1b18f79 100644 --- a/manifests/mongos.pp +++ b/manifests/mongos.pp @@ -15,11 +15,6 @@ # lint:ignore:selector_inside_resource would not add much to readability - $init_template = $::osfamily ? { - debian => template('mongodb/debian_mongos-init.conf.erb'), - redhat => template('mongodb/redhat_mongos-init.conf.erb'), - } - file { "/etc/mongos_${mongos_instance}.conf": content => template('mongodb/mongos.conf.erb'), @@ -29,7 +24,7 @@ require => Class['mongodb::install']; "/etc/init.d/mongos_${mongos_instance}": - content => $init_template, + content => template("mongodb/init.d/${::osfamily}_mongos.conf.erb"), mode => '0755', require => Class['mongodb::install'], } diff --git a/templates/debian_mongod-init.conf.erb b/templates/init.d/debian_mongod.conf.erb similarity index 100% rename from templates/debian_mongod-init.conf.erb rename to templates/init.d/debian_mongod.conf.erb diff --git a/templates/debian_mongos-init.conf.erb b/templates/init.d/debian_mongos.conf.erb similarity index 100% rename from templates/debian_mongos-init.conf.erb rename to templates/init.d/debian_mongos.conf.erb diff --git a/templates/redhat_mongod-init.conf.erb b/templates/init.d/redhat_mongod.conf.erb similarity index 100% rename from templates/redhat_mongod-init.conf.erb rename to templates/init.d/redhat_mongod.conf.erb diff --git a/templates/redhat_mongos-init.conf.erb b/templates/init.d/redhat_mongos.conf.erb similarity index 100% rename from templates/redhat_mongos-init.conf.erb rename to templates/init.d/redhat_mongos.conf.erb diff --git a/templates/replacement_mongod-init.conf.erb b/templates/init.d/replacement_mongod.conf.erb similarity index 100% rename from templates/replacement_mongod-init.conf.erb rename to templates/init.d/replacement_mongod.conf.erb From 3498043825e27281f3ae3412f9eea6ccd5ec9acf Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Wed, 22 Mar 2017 18:54:10 +0200 Subject: [PATCH 02/10] Fix resource order --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index f7c3a69..f50934c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -79,5 +79,5 @@ # ordering resources application - Mongod<| |> -> Mongos<| |> + Mongodb::Mongod<| |> -> Mongodb::Mongos<| |> } From f80cd8f9a46f596eb46fb715c2c68a716589d95f Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Wed, 22 Mar 2017 18:54:32 +0200 Subject: [PATCH 03/10] Fix the stop and disable default mongod service in init.pp Taken from https://github.com/echocat/puppet-mongodb/pull/77 --- manifests/init.pp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index f50934c..1689380 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -33,28 +33,27 @@ before => Anchor['mongodb::end'], } - # stop and disable default mongod - - service { $::mongodb::old_servicename: - ensure => stopped, - enable => false, - hasstatus => true, - hasrestart => true, - subscribe => Package['mongodb-package'], - before => Anchor['mongodb::end'], - } - # remove not wanted startup script, because it would kill all mongod # instances and not only the default mongod file { "/etc/init.d/${::mongodb::old_servicename}": ensure => file, content => template("${module_name}/init.d/replacement_mongod.conf.erb"), - require => Service[$::mongodb::old_servicename], mode => '0755', before => Anchor['mongodb::end'], } + # stop and disable default mongod + service { $::mongodb::old_servicename: + ensure => stopped, + enable => false, + hasstatus => true, + hasrestart => true, + subscribe => Package['mongodb-package'], + require => File["/etc/init.d/${::mongodb::old_servicename}"], + before => Anchor['mongodb::end'], + } + mongodb::limits::conf { 'mongod-nofile-soft': type => soft, From 1d67e4fe3f138d9ca2ad62eb838e7aa589e352e2 Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Wed, 22 Mar 2017 18:57:23 +0200 Subject: [PATCH 04/10] Ignore /vendor dir --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 35e6349..401482d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ build/ ## Environment normalisation: /.bundle/ +/vendor /lib/bundler/man/ # for a library or gem, you might want to ignore these files since the code is From 54993e146bf67c859af35fd4c6ed21cf102d3b99 Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Thu, 23 Mar 2017 14:17:18 +0200 Subject: [PATCH 05/10] Switch logrotate to yo61 for a more up to date module rodjek's stopped updating in 2014 --- .fixtures.yml | 4 ++-- README.md | 2 +- metadata.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 9f6a3c9..3a274b4 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,7 +3,7 @@ fixtures: stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git" apt: "git://github.com/puppetlabs/puppetlabs-apt.git" logrotate: - repo: "git://github.com/rodjek/puppet-logrotate.git" - ref: "1.1.1" + repo: "git://github.com/yo61/puppet-logrotate.git" + ref: "1.4.0" symlinks: mongodb: "#{source_dir}" diff --git a/README.md b/README.md index d70f533..3e38ab2 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ Array. Each field is "key" or "key=value" for parameters for config file ###Modules needed: * puppetlabs-stdlib -* rodjek-logrotate +* yo61-logrotate * puppetlabs-apt ( only for Debian/Ubuntu ) ###Software versions needed: diff --git a/metadata.json b/metadata.json index 5184a7f..81a782d 100644 --- a/metadata.json +++ b/metadata.json @@ -37,6 +37,6 @@ "dependencies": [ {"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0"}, {"name":"puppetlabs/apt","version_requirement":">= 1.1.0"}, - {"name":"rodjek/logrotate","version_requirement":">= 1.1.1"} + {"name":"yo61-logrotate","version_requirement":">= 1.4.0"} ] } From d59633e71eeb585d334a2b8eadee93fa3712c81b Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Thu, 23 Mar 2017 14:36:12 +0200 Subject: [PATCH 06/10] Fix spec --- manifests/mongod.pp | 2 +- manifests/mongos.pp | 2 +- spec/defines/mongod_spec.rb | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/manifests/mongod.pp b/manifests/mongod.pp index 85b01af..f95dad1 100644 --- a/manifests/mongod.pp +++ b/manifests/mongod.pp @@ -65,7 +65,7 @@ File[ "/etc/mongod_${mongod_instance}.conf", "/etc/init.d/mongod_${mongod_instance}"], - Service[$::mongodb::old_servicename]], + Service[$::mongodb::params::old_servicename]], before => Anchor['mongodb::end'] } diff --git a/manifests/mongos.pp b/manifests/mongos.pp index 1b18f79..3874303 100644 --- a/manifests/mongos.pp +++ b/manifests/mongos.pp @@ -57,7 +57,7 @@ require => [ File["/etc/mongos_${mongos_instance}.conf"], File["/etc/init.d/mongos_${mongos_instance}"], - Service[$::mongodb::old_servicename], + Service[$::mongodb::params::old_servicename], Start_detector['configservers']], before => Anchor['mongodb::end'] } diff --git a/spec/defines/mongod_spec.rb b/spec/defines/mongod_spec.rb index 9809e2b..035918d 100644 --- a/spec/defines/mongod_spec.rb +++ b/spec/defines/mongod_spec.rb @@ -5,7 +5,7 @@ let(:title) { 'testdb' } context 'with defaults for all parameters on RedHat' do - let(:facts) {{ :osfamily => 'RedHat' }} + let(:facts) {{ :osfamily => 'redhat' }} let :pre_condition do 'include ::mongodb::params' end @@ -17,7 +17,10 @@ end context 'with defaults for all parameters on Debian' do - let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'ubuntu' }} + let(:facts) {{ :osfamily => 'debian', :lsbdistid => 'ubuntu' }} + let :pre_condition do + 'include ::mongodb::params' + end it { should contain_mongodb__mongod('testdb') } context 'with deactivate_transparent_hugepage set' do let(:params) {{ :mongod_deactivate_transparent_hugepage => true }} From c9045a6d6a4e1427fb96b9da6d0246b4b281bafd Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Thu, 23 Mar 2017 16:02:56 +0200 Subject: [PATCH 07/10] Add pure systemd support --- manifests/init.pp | 1 + manifests/mongod.pp | 40 +++++++++++++++++++++++--- manifests/mongos.pp | 43 +++++++++++++++++++++++----- manifests/params.pp | 9 ++++++ spec/defines/mongod_spec.rb | 24 ++++++++++++---- templates/systemd/mongod.service.erb | 23 +++++++++++++++ templates/systemd/mongos.service.erb | 17 +++++++++++ 7 files changed, 140 insertions(+), 17 deletions(-) create mode 100644 templates/systemd/mongod.service.erb create mode 100644 templates/systemd/mongos.service.erb diff --git a/manifests/init.pp b/manifests/init.pp index 1689380..512451d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,6 +1,7 @@ # == Class: mongodb # class mongodb ( + $systemd_os = $mongodb::params::systemd_os, $dbdir = $mongodb::params::dbdir, $pidfilepath = $mongodb::params::pidfilepath, $logdir = $mongodb::params::logdir, diff --git a/manifests/mongod.pp b/manifests/mongod.pp index f95dad1..afd778d 100644 --- a/manifests/mongod.pp +++ b/manifests/mongod.pp @@ -20,6 +20,8 @@ # lint:ignore:selector_inside_resource would not add much to readability + $db_specific_dir = "${::mongodb::params::dbdir}/mongod_${mongod_instance}" + file { "/etc/mongod_${mongod_instance}.conf": content => template('mongodb/mongod.conf.erb'), @@ -27,13 +29,41 @@ # no auto restart of a db because of a config change # notify => Class['mongodb::service'], require => Class['mongodb::install']; + } - "/etc/init.d/mongod_${mongod_instance}": - content => template("mongodb/init.d/${::osfamily}_mongod.conf.erb"), - mode => '0755', + file { + $db_specific_dir: + ensure => directory, + owner => $::mongodb::params::run_as_user, + group => $::mongodb::params::run_as_group, require => Class['mongodb::install'], } + if $mongodb::params::systemd_os { + $service_provider = 'systemd' + file { + "/etc/init.d/mongod_${mongod_instance}": + ensure => absent, + } + file { "mongod_${mongod_instance}_service": + path => "/lib/systemd/system/mongod_${mongod_instance}.service", + content => template('mongodb/systemd/mongod.service.erb'), + mode => '0644', + require => [ + Class['mongodb::install'], + File["/etc/init.d/mongod_${mongod_instance}"] + ] + } + } else { + $service_provider = 'init' + file { "mongod_${mongod_instance}_service": + path => "/etc/init.d/mongod_${mongod_instance}", + content => template("mongodb/init.d/${::osfamily}_mongod.conf.erb"), + mode => '0755', + require => Class['mongodb::install'], + } + } + # lint:endignore if ($mongod_monit != false) { @@ -61,10 +91,12 @@ enable => $mongod_enable, hasstatus => true, hasrestart => true, + provider => $service_provider, require => [ File[ "/etc/mongod_${mongod_instance}.conf", - "/etc/init.d/mongod_${mongod_instance}"], + "mongod_${mongod_instance}_service", + $db_specific_dir], Service[$::mongodb::params::old_servicename]], before => Anchor['mongodb::end'] } diff --git a/manifests/mongos.pp b/manifests/mongos.pp index 3874303..016dc9c 100644 --- a/manifests/mongos.pp +++ b/manifests/mongos.pp @@ -15,6 +15,8 @@ # lint:ignore:selector_inside_resource would not add much to readability + $db_specific_dir = "${::mongodb::params::dbdir}/mongos_${mongos_instance}" + file { "/etc/mongos_${mongos_instance}.conf": content => template('mongodb/mongos.conf.erb'), @@ -22,11 +24,35 @@ # no auto restart of a db because of a config change # notify => Class['mongodb::service'], require => Class['mongodb::install']; + $db_specific_dir: + ensure => directory, + owner => $::mongodb::params::run_as_user, + group => $::mongodb::params::run_as_group; + } - "/etc/init.d/mongos_${mongos_instance}": - content => template("mongodb/init.d/${::osfamily}_mongos.conf.erb"), - mode => '0755', - require => Class['mongodb::install'], + if $mongodb::params::systemd_os { + $service_provider = 'systemd' + file { + "/etc/init.d/mongos_${mongos_instance}": + ensure => absent, + } + file { "mongos_${mongos_instance}_service": + path => "/lib/systemd/system/mongos_${mongos_instance}.service", + content => template('mongodb/systemd/mongos.service.erb'), + mode => '0644', + require => [ + Class['mongodb::install'], + File["/etc/init.d/mongos_${mongos_instance}"] + ] + } + } else { + $service_provider = 'init' + file { "mongos_${mongos_instance}_service": + path => "/etc/init.d/mongos_${mongos_instance}", + content => template("mongodb/init.d/${::osfamily}_mongos.conf.erb"), + mode => '0755', + require => Class['mongodb::install'], + } } # wait for servers starting @@ -42,7 +68,7 @@ file { "/etc/mongos_${mongos_instance}.key": content => template('mongodb/mongos.key.erb'), mode => '0700', - owner => $::mongodb::run_as_user, + owner => $::mongodb::params::run_as_user, require => Class['mongodb::install'], notify => Service["mongos_${mongos_instance}"], } @@ -54,9 +80,12 @@ enable => $mongos_enable, hasstatus => true, hasrestart => true, + provider => $service_provider, require => [ - File["/etc/mongos_${mongos_instance}.conf"], - File["/etc/init.d/mongos_${mongos_instance}"], + File[ + "/etc/mongos_${mongos_instance}.conf", + "mongos_${mongos_instance}_service", + $db_specific_dir], Service[$::mongodb::params::old_servicename], Start_detector['configservers']], before => Anchor['mongodb::end'] diff --git a/manifests/params.pp b/manifests/params.pp index 2d62dd5..5bf71e7 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -26,6 +26,15 @@ } } + case $::osfamily { + 'Debian': { + $systemd_os = versioncmp($::operatingsystemmajrelease, '15.10') > 0 + } + 'RedHat': { + $systemd_os = versioncmp($::operatingsystemmajrelease, '7') > 0 + } + } + # directorypath to store db directory in # subdirectories for each mongo instance will be created diff --git a/spec/defines/mongod_spec.rb b/spec/defines/mongod_spec.rb index 035918d..88407be 100644 --- a/spec/defines/mongod_spec.rb +++ b/spec/defines/mongod_spec.rb @@ -4,27 +4,39 @@ let(:title) { 'testdb' } - context 'with defaults for all parameters on RedHat' do - let(:facts) {{ :osfamily => 'redhat' }} - let :pre_condition do + context 'with defaults for all parameters on pre-systemd RedHat' do + let(:facts) {{ :osfamily => 'redhat', :operatingsystemmajrelease => '6' }} + let :pre_condition do 'include ::mongodb::params' end it { should contain_mongodb__mongod('testdb') } context 'with deactivate_transparent_hugepage set' do let(:params) {{ :mongod_deactivate_transparent_hugepage => true }} - it { should contain_file("/etc/init.d/mongod_testdb").with_content(/\/sys\/kernel\/mm\/transparent_hugepage\//) } + it { should contain_file("mongod_testdb_service").with_path("/etc/init.d/mongod_testdb").with_content(/\/sys\/kernel\/mm\/transparent_hugepage\//) } + end + end + + context 'with defaults for all parameters on pre-systemd Debian' do + let(:facts) {{ :osfamily => 'debian', :lsbdistid => 'ubuntu', :operatingsystemmajrelease => '14.04' }} + let :pre_condition do + 'include ::mongodb::params' + end + it { should contain_mongodb__mongod('testdb') } + context 'with deactivate_transparent_hugepage set' do + let(:params) {{ :mongod_deactivate_transparent_hugepage => true }} + it { should contain_file("mongod_testdb_service").with_path("/etc/init.d/mongod_testdb").with_content(/\/sys\/kernel\/mm\/transparent_hugepage\//) } end end context 'with defaults for all parameters on Debian' do - let(:facts) {{ :osfamily => 'debian', :lsbdistid => 'ubuntu' }} + let(:facts) {{ :osfamily => 'debian', :lsbdistid => 'ubuntu', :operatingsystemmajrelease => '16.04' }} let :pre_condition do 'include ::mongodb::params' end it { should contain_mongodb__mongod('testdb') } context 'with deactivate_transparent_hugepage set' do let(:params) {{ :mongod_deactivate_transparent_hugepage => true }} - it { should contain_file("/etc/init.d/mongod_testdb").with_content(/\/sys\/kernel\/mm\/transparent_hugepage\//) } + it { should contain_file("mongod_testdb_service").with_path("/lib/systemd/system/mongod_testdb.service").with_content(/\/sys\/kernel\/mm\/transparent_hugepage\//) } end end diff --git a/templates/systemd/mongod.service.erb b/templates/systemd/mongod.service.erb new file mode 100644 index 0000000..5380454 --- /dev/null +++ b/templates/systemd/mongod.service.erb @@ -0,0 +1,23 @@ +[Unit] +Description=Mongos_<%= @mongod_instance %> server +Wants=network.target +After=network.target + +[Service] +Type=forking +PIDFile=<%= scope.lookupvar('mongodb::pidfilepath') %>/mongod_<%= @mongod_instance %>/mongod.pid +ExecStart=/usr/bin/mongod --config /etc/mongod_<%= @mongod_instance %>.conf +Restart=on-failure +User=<%= scope.lookupvar('mongodb::run_as_user') %> +Group=<%= scope.lookupvar('mongodb::run_as_group') %> +LimitNOFILE=<%= scope.lookupvar('mongodb::ulimit_nofiles') %> +LimitNPROC=<%= scope.lookupvar('mongodb::ulimit_nproc') %> +<% if @mongod_deactivate_transparent_hugepage -%> +<%# implement mdiag.sh best-practice %> +ExecPreStart=/bin/bash -c 'test -f /sys/kernel/mm/transparent_hugepage/khugepaged/defrag && echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag' +ExecPreStart=/bin/bash -c 'test -f /sys/kernel/mm/transparent_hugepage/defrag && echo never > /sys/kernel/mm/transparent_hugepage/defrag' +ExecPreStart=/bin/bash -c 'test -f /sys/kernel/mm/transparent_hugepage/enabled && echo never > /sys/kernel/mm/transparent_hugepage/enabled' +<% end -%> + +[Install] +WantedBy=multi-user.target diff --git a/templates/systemd/mongos.service.erb b/templates/systemd/mongos.service.erb new file mode 100644 index 0000000..e268c92 --- /dev/null +++ b/templates/systemd/mongos.service.erb @@ -0,0 +1,17 @@ +[Unit] +Description=Mongos_<%= @mongos_instance %> server +Wants=network.target +After=network.target + +[Service] +Type=forking +PIDFile=<%= scope.lookupvar('mongodb::pidfilepath') %>/mongos_<%= @mongos_instance %>/mongos.pid +ExecStart=/usr/bin/mongos --config /etc/mongos_<%= @mongos_instance %>.conf +Restart=on-failure +User=<%= scope.lookupvar('mongodb::run_as_user') %> +Group=<%= scope.lookupvar('mongodb::run_as_group') %> +LimitNOFILE=<%= scope.lookupvar('mongodb::ulimit_nofiles') %> +LimitNPROC=<%= scope.lookupvar('mongodb::ulimit_nproc') %> + +[Install] +WantedBy=multi-user.target From cabd116d150aa901b9c8bb2c5436dd9a09eed2ae Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Thu, 23 Mar 2017 16:06:05 +0200 Subject: [PATCH 08/10] Ignore Gemfile.lock --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 401482d..962c261 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +Gemfile.lock *.gem *.rbc *.swp From cfd9b717bfc762d1f91db2bce89a38d3109a5229 Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Sun, 26 Mar 2017 16:30:37 +0300 Subject: [PATCH 09/10] metadata: drop unsupported PE requirement --- metadata.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/metadata.json b/metadata.json index 81a782d..9959f4a 100644 --- a/metadata.json +++ b/metadata.json @@ -17,10 +17,6 @@ } ], "requirements": [ - { - "name": "pe", - "version_requirement": "3.x" - }, { "name": "puppet", "version_requirement": ">=2.7.20 <5.0.0" From f0639346932bc93988e481f41c8e8cdec84d9162 Mon Sep 17 00:00:00 2001 From: Boris Peterbarg Date: Sun, 26 Mar 2017 16:38:28 +0300 Subject: [PATCH 10/10] Clean up some lint complaints --- manifests/mongod.pp | 4 ---- manifests/mongos.pp | 2 -- manifests/params.pp | 3 +++ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/manifests/mongod.pp b/manifests/mongod.pp index afd778d..9f88dfa 100644 --- a/manifests/mongod.pp +++ b/manifests/mongod.pp @@ -18,8 +18,6 @@ $mongod_deactivate_transparent_hugepage = false, ) { -# lint:ignore:selector_inside_resource would not add much to readability - $db_specific_dir = "${::mongodb::params::dbdir}/mongod_${mongod_instance}" file { @@ -64,8 +62,6 @@ } } -# lint:endignore - if ($mongod_monit != false) { # notify { "mongod_monit is : ${mongod_monit}": } class { 'mongodb::monit': diff --git a/manifests/mongos.pp b/manifests/mongos.pp index 016dc9c..b08d242 100644 --- a/manifests/mongos.pp +++ b/manifests/mongos.pp @@ -13,8 +13,6 @@ $mongos_add_options = [] ) { -# lint:ignore:selector_inside_resource would not add much to readability - $db_specific_dir = "${::mongodb::params::dbdir}/mongos_${mongos_instance}" file { diff --git a/manifests/params.pp b/manifests/params.pp index 5bf71e7..abb39e4 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -33,6 +33,9 @@ 'RedHat': { $systemd_os = versioncmp($::operatingsystemmajrelease, '7') > 0 } + default: { # deal with lint + $systemd_os = false + } } # directorypath to store db directory in