Skip to content

Commit 23068c1

Browse files
authored
Merge pull request #406 from wyardley/data_types
Add Data Types and remove deprecated parameters
2 parents c60e4ca + c10e72d commit 23068c1

22 files changed

Lines changed: 298 additions & 420 deletions

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ instance, without sharding functionality.
4343
### Beginning with MongoDB
4444

4545
If you just want a server installation with the default options you can run
46-
`include '::mongodb::server'`. If you need to customize configuration
46+
`include mongodb::server`. If you need to customize configuration
4747
options you need to do the following:
4848

4949
```puppet
50-
class {'::mongodb::server':
50+
class {'mongodb::server':
5151
port => 27018,
5252
verbose => true,
5353
}
@@ -56,7 +56,7 @@ class {'::mongodb::server':
5656
For Red Hat family systems, the client can be installed in a similar fashion:
5757

5858
```puppet
59-
class {'::mongodb::client':}
59+
class {'mongodb::client':}
6060
```
6161

6262
Note that for Debian/Ubuntu family systems the client is installed with the
@@ -66,7 +66,7 @@ If one plans to configure sharding for a Mongo deployment, the module offer
6666
the `mongos` installation. `mongos` can be installed the following way :
6767

6868
```puppet
69-
class {'::mongodb::mongos' :
69+
class {'mongodb::mongos' :
7070
configdb => ['configsvr1.example.com:27018'],
7171
}
7272
```
@@ -77,37 +77,37 @@ packages are outdated and not appropriate for a production environment.
7777
To install MongoDB from 10gen repository:
7878

7979
```puppet
80-
class {'::mongodb::globals':
80+
class {'mongodb::globals':
8181
manage_package_repo => true,
82-
}->
83-
class {'::mongodb::client': } ->
84-
class {'::mongodb::server': }
82+
}
83+
-> class {'mongodb::client': }
84+
-> class {'mongodb::server': }
8585
```
8686

8787
If you don't want to use the 10gen/MongoDB software repository or the OS packages,
8888
you can point the module to a custom one.
8989
To install MongoDB from a custom repository:
9090

9191
```puppet
92-
class {'::mongodb::globals':
92+
class {'mongodb::globals':
9393
manage_package_repo => true,
9494
repo_location => 'http://example.com/repo'
95-
}->
96-
class {'::mongodb::server': }->
97-
class {'::mongodb::client': }
95+
}
96+
-> class {'mongodb::server': }
97+
-> class {'mongodb::client': }
9898
```
9999

100100
Having a local copy of MongoDB repository (that is managed by your private modules)
101101
you can still enjoy the charms of `mongodb::params` that manage packages.
102102
To disable managing of repository, but still enable managing packages:
103103

104104
```puppet
105-
class {'::mongodb::globals':
105+
class {'mongodb::globals':
106106
manage_package_repo => false,
107107
manage_package => true,
108-
}->
109-
class {'::mongodb::server': }->
110-
class {'::mongodb::client': }
108+
}
109+
-> class {'mongodb::server': }
110+
-> class {'mongodb::client': }
111111
```
112112

113113
## Usage
@@ -124,7 +124,7 @@ On its own it does nothing.
124124
To install MongoDB server, create database "testdb" and user "user1" with password "pass1".
125125

126126
```puppet
127-
class {'::mongodb::server':
127+
class {'mongodb::server':
128128
auth => true,
129129
}
130130

examples/client.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
class { '::mongodb::globals': manage_package_repo => true }
2-
-> class { '::mongodb::client': }
1+
class { 'mongodb::globals': manage_package_repo => true }
2+
-> class { 'mongodb::client': }

examples/globals.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class { '::mongodb::globals':
1+
class { 'mongodb::globals':
22
manage_package_repo => true,
33
}

examples/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
class { '::mongodb': }
1+
class { 'mongodb': }

examples/replicaset.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
node default {
2-
class { '::mongodb::globals':
2+
class { 'mongodb::globals':
33
manage_package_repo => true,
44
}
5-
-> class { '::mongodb::server':
5+
-> class { 'mongodb::server':
66
smallfiles => true,
77
bind_ip => ['0.0.0.0'],
88
replset => 'rsmain',

examples/server.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
class { '::mongodb::globals': manage_package_repo => true }
2-
-> class { '::mongodb::server': }
1+
class { 'mongodb::globals': manage_package_repo => true }
2+
-> class { 'mongodb::server': }

examples/sharding.pp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
node 'mongos' {
22

3-
class {'::mongodb::globals':
3+
class {'mongodb::globals':
44
manage_package_repo => true,
55
}
6-
-> class {'::mongodb::server':
6+
-> class {'mongodb::server':
77
configsvr => true,
88
bind_ip => $::ipaddress,
99
}
10-
-> class {'::mongodb::client': }
11-
-> class {'::mongodb::mongos':
10+
-> class {'mongodb::client': }
11+
-> class {'mongodb::mongos':
1212
configdb => ["${::ipaddress}:27019"],
1313
}
1414
-> mongodb_shard { 'rs1' :
@@ -24,31 +24,31 @@
2424

2525
node 'mongod1' {
2626

27-
class {'::mongodb::globals':
27+
class {'mongodb::globals':
2828
manage_package_repo => true,
2929
}
30-
-> class {'::mongodb::server':
30+
-> class {'mongodb::server':
3131
shardsvr => true,
3232
replset => 'rs1',
3333
bind_ip => $::ipaddress,
3434
}
35-
-> class {'::mongodb::client': }
35+
-> class {'mongodb::client': }
3636
mongodb_replset{'rs1':
3737
members => ['mongod1:27018', 'mongod2:27018'],
3838
}
3939
}
4040

4141
node 'mongod2' {
4242

43-
class {'::mongodb::globals':
43+
class {'mongodb::globals':
4444
manage_package_repo => true,
4545
}
46-
-> class {'::mongodb::server':
46+
-> class {'mongodb::server':
4747
shardsvr => true,
4848
replset => 'rs1',
4949
bind_ip => $::ipaddress,
5050
}
51-
-> class {'::mongodb::client': }
51+
-> class {'mongodb::client': }
5252
mongodb_replset{'rs1':
5353
members => ['mongod1:27018', 'mongod2:27018'],
5454
}

lib/puppet/provider/mongodb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.mongo_conf
2727
file = mongod_conf_file
2828
# The mongo conf is probably a key-value store, even though 2.6 is
2929
# supposed to use YAML, because the config template is applied
30-
# based on $::mongodb::globals::version which is the user will not
30+
# based on $mongodb::globals::version which is the user will not
3131
# necessarily set. This attempts to get the port from both types of
3232
# config files.
3333
config = YAML.load_file(file)

manifests/client.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# is repository dependent.
1010
#
1111
class mongodb::client (
12-
$ensure = $mongodb::params::package_ensure_client,
13-
$package_name = $mongodb::params::client_package_name,
12+
Variant[Boolean, String] $ensure = $mongodb::params::package_ensure_client,
13+
Optional[String] $package_name = $mongodb::params::client_package_name,
1414
) inherits mongodb::params {
15-
anchor { '::mongodb::client::start': }
16-
-> class { '::mongodb::client::install': }
17-
-> anchor { '::mongodb::client::end': }
15+
anchor { 'mongodb::client::start': }
16+
-> class { 'mongodb::client::install': }
17+
-> anchor { 'mongodb::client::end': }
1818
}

manifests/globals.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
fail('You must set mongodb::globals::version when mongodb::globals::use_enterprise_repo is true')
4545
}
4646

47-
class { '::mongodb::repo':
47+
class { 'mongodb::repo':
4848
ensure => present,
4949
repo_location => $repo_location,
5050
proxy => $repo_proxy,

0 commit comments

Comments
 (0)