Skip to content

Commit

Permalink
puppet-lint: autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak authored and ekohl committed Aug 24, 2020
1 parent 46c3b59 commit 804a27c
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 44 deletions.
4 changes: 2 additions & 2 deletions examples/replicaset.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
bind_ip => ['0.0.0.0'],
replset => 'rsmain',
}
mongodb_replset{'rsmain':
members => ['mongo1:27017', 'mongo2:27017', 'mongo3:27017' ],
mongodb_replset { 'rsmain':
members => ['mongo1:27017', 'mongo2:27017', 'mongo3:27017'],
arbiter => 'mongo3:27017',
}
}
35 changes: 15 additions & 20 deletions examples/sharding.pp
Original file line number Diff line number Diff line change
@@ -1,56 +1,51 @@
node 'mongos' {

class {'mongodb::globals':
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class {'mongodb::server':
-> class { 'mongodb::server':
configsvr => true,
bind_ip => [$facts['networking']['ip']],
}
-> class {'mongodb::client': }
-> class {'mongodb::mongos':
-> class { 'mongodb::client': }
-> class { 'mongodb::mongos':
configdb => ["${facts['networking']['ip']}:27019"],
}
-> mongodb_shard { 'rs1' :
member => 'rs1/mongod1:27018',
keys => [{
'rs1.foo' => {
'name' => 1,
}
'rs1.foo' => {
'name' => 1,
}
}],
}

}

node 'mongod1' {

class {'mongodb::globals':
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class {'mongodb::server':
-> class { 'mongodb::server':
shardsvr => true,
replset => 'rs1',
bind_ip => [$facts['networking']['ip']],
}
-> class {'mongodb::client': }
mongodb_replset{'rs1':
-> class { 'mongodb::client': }
mongodb_replset { 'rs1':
members => ['mongod1:27018', 'mongod2:27018'],
}
}

node 'mongod2' {

class {'mongodb::globals':
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class {'mongodb::server':
-> class { 'mongodb::server':
shardsvr => true,
replset => 'rs1',
bind_ip => [$facts['networking']['ip']],
}
-> class {'mongodb::client': }
mongodb_replset{'rs1':
-> class { 'mongodb::client': }
mongodb_replset { 'rs1':
members => ['mongod1:27018', 'mongod2:27018'],
}

}
1 change: 0 additions & 1 deletion manifests/db.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Array[String] $roles = ['dbAdmin'],
Integer[0] $tries = 10,
) {

unless $facts['mongodb_is_master'] == 'false' { # lint:ignore:quoted_booleans
mongodb_database { $db_name:
ensure => present,
Expand Down
1 change: 0 additions & 1 deletion manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
$pidfilemode = undef,
$manage_pidfile = undef,
) {

if $use_enterprise_repo {
$edition = 'enterprise'
} else {
Expand Down
1 change: 0 additions & 1 deletion manifests/mongos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@
} else {
Class['mongodb::mongos::service'] -> Class['mongodb::mongos::config'] -> Class['mongodb::mongos::install']
}

}
2 changes: 0 additions & 2 deletions manifests/mongos/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
$package_ensure = $mongodb::mongos::package_ensure,
$package_name = $mongodb::mongos::package_name,
) {

unless defined(Package[$package_name]) {
package { 'mongodb_mongos':
ensure => $package_ensure,
name => $package_name,
tag => 'mongodb_package',
}
}

}
2 changes: 0 additions & 2 deletions manifests/mongos/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
$bind_ip = $mongodb::mongos::bind_ip,
$port = $mongodb::mongos::port,
) {

if $package_ensure in ['absent', 'purged'] {
$real_service_ensure = 'stopped'
$real_service_enable = false
Expand Down Expand Up @@ -43,5 +42,4 @@
}
}
}

}
1 change: 0 additions & 1 deletion manifests/opsmanager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
Optional[Integer] $snapshot_monthly_retention = undef, # Default: 1
Optional[Integer] $versions_directory = undef, # Linux default: /opt/mongodb/mms/mongodb-releases/
) {

case $package_ensure {
'absent': {
$my_package_ensure = 'absent'
Expand Down
3 changes: 1 addition & 2 deletions manifests/replset.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Wrapper class useful for hiera based deployments
class mongodb::replset(
class mongodb::replset (
$sets = undef
) {

if $sets {
create_resources(mongodb_replset, $sets)
}
Expand Down
3 changes: 0 additions & 3 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
Boolean $store_creds = $mongodb::params::store_creds,
Array $admin_roles = $mongodb::params::admin_roles,
) inherits mongodb::params {

contain mongodb::server::install
contain mongodb::server::config
contain mongodb::server::service
Expand Down Expand Up @@ -122,7 +121,6 @@
if $replset_config {
# Copy it to REAL value
$_replset_config = $replset_config

} else {
# Build up a config hash
$_replset_config = {
Expand All @@ -144,7 +142,6 @@
if $create_admin {
Class['mongodb::replset'] -> Mongodb::Db['admin']
}

}
}
}
6 changes: 2 additions & 4 deletions manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@
group => $group,
}

if ($logpath and $syslog) { fail('You cannot use syslog with logpath')}
if ($logpath and $syslog) { fail('You cannot use syslog with logpath') }

if ($ensure == 'present' or $ensure == true) {

# Exists for future compatibility and clarity.
if $auth {
$noauth = false
Expand All @@ -99,7 +98,6 @@
$storage_engine_internal = $storage_engine
}


# Pick which config content to use
if $config_content {
$cfg_content = $config_content
Expand Down Expand Up @@ -165,7 +163,7 @@
if $handle_creds {
if $auth and $store_creds {
file { $rcfile:
ensure => present,
ensure => file,
content => template('mongodb/mongorc.js.erb'),
owner => 'root',
group => 'root',
Expand Down
1 change: 0 additions & 1 deletion manifests/server/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@
}
}
}

}
4 changes: 1 addition & 3 deletions manifests/shardsvr.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Wrapper class useful for hiera based deployments
class mongodb::shardsvr(
class mongodb::shardsvr (
$shards = undef
) {

if $shards {
create_resources(mongodb_shard, $shards)
}

}
2 changes: 1 addition & 1 deletion spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@

it {
is_expected.to contain_file('/root/.mongorc.js').
with_ensure('present').
with_ensure('file').
with_owner('root').
with_group('root').
with_mode('0600').
Expand Down

0 comments on commit 804a27c

Please sign in to comment.