Skip to content

Commit

Permalink
Remove leading colons on class name and improve syntax in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
William Yardley committed Oct 21, 2017
1 parent 9d8fcc5 commit 6c9b463
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 108 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ instance, without sharding functionality.
### Beginning with MongoDB

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

```puppet
class {'::mongodb::server':
class {'mongodb::server':
port => 27018,
verbose => true,
}
Expand All @@ -56,7 +56,7 @@ class {'::mongodb::server':
For Red Hat family systems, the client can be installed in a similar fashion:

```puppet
class {'::mongodb::client':}
class {'mongodb::client':}
```

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

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

```puppet
class {'::mongodb::globals':
class {'mongodb::globals':
manage_package_repo => true,
}->
class {'::mongodb::client': } ->
class {'::mongodb::server': }
}
-> class {'mongodb::client': }
-> class {'mongodb::server': }
```

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

```puppet
class {'::mongodb::globals':
class {'mongodb::globals':
manage_package_repo => true,
repo_location => 'http://example.com/repo'
}->
class {'::mongodb::server': }->
class {'::mongodb::client': }
}
-> class {'mongodb::server': }
-> class {'mongodb::client': }
```

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

```puppet
class {'::mongodb::globals':
class {'mongodb::globals':
manage_package_repo => false,
manage_package => true,
}->
class {'::mongodb::server': }->
class {'::mongodb::client': }
}
-> class {'mongodb::server': }
-> class {'mongodb::client': }
```

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

```puppet
class {'::mongodb::server':
class {'mongodb::server':
auth => true,
}
Expand Down
4 changes: 2 additions & 2 deletions examples/client.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class { '::mongodb::globals': manage_package_repo => true }
-> class { '::mongodb::client': }
class { 'mongodb::globals': manage_package_repo => true }
-> class { 'mongodb::client': }
2 changes: 1 addition & 1 deletion examples/globals.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class { '::mongodb::globals':
class { 'mongodb::globals':
manage_package_repo => true,
}
2 changes: 1 addition & 1 deletion examples/init.pp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class { '::mongodb': }
class { 'mongodb': }
4 changes: 2 additions & 2 deletions examples/replicaset.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
node default {
class { '::mongodb::globals':
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class { '::mongodb::server':
-> class { 'mongodb::server':
smallfiles => true,
bind_ip => ['0.0.0.0'],
replset => 'rsmain',
Expand Down
4 changes: 2 additions & 2 deletions examples/server.pp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class { '::mongodb::globals': manage_package_repo => true }
-> class { '::mongodb::server': }
class { 'mongodb::globals': manage_package_repo => true }
-> class { 'mongodb::server': }
20 changes: 10 additions & 10 deletions examples/sharding.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
node 'mongos' {

class {'::mongodb::globals':
class {'mongodb::globals':
manage_package_repo => true,
}
-> class {'::mongodb::server':
-> class {'mongodb::server':
configsvr => true,
bind_ip => $::ipaddress,
}
-> class {'::mongodb::client': }
-> class {'::mongodb::mongos':
-> class {'mongodb::client': }
-> class {'mongodb::mongos':
configdb => ["${::ipaddress}:27019"],
}
-> mongodb_shard { 'rs1' :
Expand All @@ -24,31 +24,31 @@

node 'mongod1' {

class {'::mongodb::globals':
class {'mongodb::globals':
manage_package_repo => true,
}
-> class {'::mongodb::server':
-> class {'mongodb::server':
shardsvr => true,
replset => 'rs1',
bind_ip => $::ipaddress,
}
-> class {'::mongodb::client': }
-> 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 => $::ipaddress,
}
-> class {'::mongodb::client': }
-> class {'mongodb::client': }
mongodb_replset{'rs1':
members => ['mongod1:27018', 'mongod2:27018'],
}
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.mongo_conf
file = mongod_conf_file
# The mongo conf is probably a key-value store, even though 2.6 is
# supposed to use YAML, because the config template is applied
# based on $::mongodb::globals::version which is the user will not
# based on $mongodb::globals::version which is the user will not
# necessarily set. This attempts to get the port from both types of
# config files.
config = YAML.load_file(file)
Expand Down
6 changes: 3 additions & 3 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Variant[Boolean, String] $ensure = $mongodb::params::package_ensure_client,
Optional[String] $package_name = $mongodb::params::client_package_name,
) inherits mongodb::params {
anchor { '::mongodb::client::start': }
-> class { '::mongodb::client::install': }
-> anchor { '::mongodb::client::end': }
anchor { 'mongodb::client::start': }
-> class { 'mongodb::client::install': }
-> anchor { 'mongodb::client::end': }
}
2 changes: 1 addition & 1 deletion manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
fail('You must set mongodb::globals::version when mongodb::globals::use_enterprise_repo is true')
}

class { '::mongodb::repo':
class { 'mongodb::repo':
ensure => present,
repo_location => $repo_location,
proxy => $repo_proxy,
Expand Down
6 changes: 3 additions & 3 deletions manifests/mongos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
}
} else {
anchor { 'mongodb::mongos::start': }
-> class { '::mongodb::mongos::service': }
-> class { '::mongodb::mongos::config': }
-> class { '::mongodb::mongos::install': }
-> class { 'mongodb::mongos::service': }
-> class { 'mongodb::mongos::config': }
-> class { 'mongodb::mongos::install': }
-> anchor { 'mongodb::mongos::end': }
}

Expand Down
Loading

0 comments on commit 6c9b463

Please sign in to comment.