Skip to content

Commit 804a27c

Browse files
bastelfreakekohl
authored andcommitted
puppet-lint: autofix
1 parent 46c3b59 commit 804a27c

14 files changed

+22
-44
lines changed

examples/replicaset.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
bind_ip => ['0.0.0.0'],
88
replset => 'rsmain',
99
}
10-
mongodb_replset{'rsmain':
11-
members => ['mongo1:27017', 'mongo2:27017', 'mongo3:27017' ],
10+
mongodb_replset { 'rsmain':
11+
members => ['mongo1:27017', 'mongo2:27017', 'mongo3:27017'],
1212
arbiter => 'mongo3:27017',
1313
}
1414
}

examples/sharding.pp

+15-20
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,51 @@
11
node 'mongos' {
2-
3-
class {'mongodb::globals':
2+
class { 'mongodb::globals':
43
manage_package_repo => true,
54
}
6-
-> class {'mongodb::server':
5+
-> class { 'mongodb::server':
76
configsvr => true,
87
bind_ip => [$facts['networking']['ip']],
98
}
10-
-> class {'mongodb::client': }
11-
-> class {'mongodb::mongos':
9+
-> class { 'mongodb::client': }
10+
-> class { 'mongodb::mongos':
1211
configdb => ["${facts['networking']['ip']}:27019"],
1312
}
1413
-> mongodb_shard { 'rs1' :
1514
member => 'rs1/mongod1:27018',
1615
keys => [{
17-
'rs1.foo' => {
18-
'name' => 1,
19-
}
16+
'rs1.foo' => {
17+
'name' => 1,
18+
}
2019
}],
2120
}
22-
2321
}
2422

2523
node 'mongod1' {
26-
27-
class {'mongodb::globals':
24+
class { 'mongodb::globals':
2825
manage_package_repo => true,
2926
}
30-
-> class {'mongodb::server':
27+
-> class { 'mongodb::server':
3128
shardsvr => true,
3229
replset => 'rs1',
3330
bind_ip => [$facts['networking']['ip']],
3431
}
35-
-> class {'mongodb::client': }
36-
mongodb_replset{'rs1':
32+
-> class { 'mongodb::client': }
33+
mongodb_replset { 'rs1':
3734
members => ['mongod1:27018', 'mongod2:27018'],
3835
}
3936
}
4037

4138
node 'mongod2' {
42-
43-
class {'mongodb::globals':
39+
class { 'mongodb::globals':
4440
manage_package_repo => true,
4541
}
46-
-> class {'mongodb::server':
42+
-> class { 'mongodb::server':
4743
shardsvr => true,
4844
replset => 'rs1',
4945
bind_ip => [$facts['networking']['ip']],
5046
}
51-
-> class {'mongodb::client': }
52-
mongodb_replset{'rs1':
47+
-> class { 'mongodb::client': }
48+
mongodb_replset { 'rs1':
5349
members => ['mongod1:27018', 'mongod2:27018'],
5450
}
55-
5651
}

manifests/db.pp

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
Array[String] $roles = ['dbAdmin'],
2020
Integer[0] $tries = 10,
2121
) {
22-
2322
unless $facts['mongodb_is_master'] == 'false' { # lint:ignore:quoted_booleans
2423
mongodb_database { $db_name:
2524
ensure => present,

manifests/globals.pp

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
$pidfilemode = undef,
3232
$manage_pidfile = undef,
3333
) {
34-
3534
if $use_enterprise_repo {
3635
$edition = 'enterprise'
3736
} else {

manifests/mongos.pp

-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@
3838
} else {
3939
Class['mongodb::mongos::service'] -> Class['mongodb::mongos::config'] -> Class['mongodb::mongos::install']
4040
}
41-
4241
}

manifests/mongos/install.pp

-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
$package_ensure = $mongodb::mongos::package_ensure,
44
$package_name = $mongodb::mongos::package_name,
55
) {
6-
76
unless defined(Package[$package_name]) {
87
package { 'mongodb_mongos':
98
ensure => $package_ensure,
109
name => $package_name,
1110
tag => 'mongodb_package',
1211
}
1312
}
14-
1513
}

manifests/mongos/service.pp

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
$bind_ip = $mongodb::mongos::bind_ip,
1111
$port = $mongodb::mongos::port,
1212
) {
13-
1413
if $package_ensure in ['absent', 'purged'] {
1514
$real_service_ensure = 'stopped'
1615
$real_service_enable = false
@@ -43,5 +42,4 @@
4342
}
4443
}
4544
}
46-
4745
}

manifests/opsmanager.pp

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
Optional[Integer] $snapshot_monthly_retention = undef, # Default: 1
5656
Optional[Integer] $versions_directory = undef, # Linux default: /opt/mongodb/mms/mongodb-releases/
5757
) {
58-
5958
case $package_ensure {
6059
'absent': {
6160
$my_package_ensure = 'absent'

manifests/replset.pp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Wrapper class useful for hiera based deployments
2-
class mongodb::replset(
2+
class mongodb::replset (
33
$sets = undef
44
) {
5-
65
if $sets {
76
create_resources(mongodb_replset, $sets)
87
}

manifests/server.pp

-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
Boolean $store_creds = $mongodb::params::store_creds,
8181
Array $admin_roles = $mongodb::params::admin_roles,
8282
) inherits mongodb::params {
83-
8483
contain mongodb::server::install
8584
contain mongodb::server::config
8685
contain mongodb::server::service
@@ -122,7 +121,6 @@
122121
if $replset_config {
123122
# Copy it to REAL value
124123
$_replset_config = $replset_config
125-
126124
} else {
127125
# Build up a config hash
128126
$_replset_config = {
@@ -144,7 +142,6 @@
144142
if $create_admin {
145143
Class['mongodb::replset'] -> Mongodb::Db['admin']
146144
}
147-
148145
}
149146
}
150147
}

manifests/server/config.pp

+2-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@
7373
group => $group,
7474
}
7575

76-
if ($logpath and $syslog) { fail('You cannot use syslog with logpath')}
76+
if ($logpath and $syslog) { fail('You cannot use syslog with logpath') }
7777

7878
if ($ensure == 'present' or $ensure == true) {
79-
8079
# Exists for future compatibility and clarity.
8180
if $auth {
8281
$noauth = false
@@ -99,7 +98,6 @@
9998
$storage_engine_internal = $storage_engine
10099
}
101100

102-
103101
# Pick which config content to use
104102
if $config_content {
105103
$cfg_content = $config_content
@@ -165,7 +163,7 @@
165163
if $handle_creds {
166164
if $auth and $store_creds {
167165
file { $rcfile:
168-
ensure => present,
166+
ensure => file,
169167
content => template('mongodb/mongorc.js.erb'),
170168
owner => 'root',
171169
group => 'root',

manifests/server/service.pp

-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,4 @@
5555
}
5656
}
5757
}
58-
5958
}

manifests/shardsvr.pp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Wrapper class useful for hiera based deployments
2-
class mongodb::shardsvr(
2+
class mongodb::shardsvr (
33
$shards = undef
44
) {
5-
65
if $shards {
76
create_resources(mongodb_shard, $shards)
87
}
9-
108
}

spec/classes/server_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237

238238
it {
239239
is_expected.to contain_file('/root/.mongorc.js').
240-
with_ensure('present').
240+
with_ensure('file').
241241
with_owner('root').
242242
with_group('root').
243243
with_mode('0600').

0 commit comments

Comments
 (0)