parallels-cookbooks / mongodb3-objects

Chef LWRP resources to manage MongoDB 3.x
Other
2 stars 2 forks source link

mongodb3-objects

Cookbook Version

Description

This cookbook is a wrapper over the mongodb3 cookbook. It contains LWRP resources to create:

Requirements

Platforms

Tested on Centos 6 and 7, but could work on any other Linux.

Cookbooks

Resources

mongodb_admin

Creates administrator account. If authentication mechanism was enabled in configuration already, only request from localhost to create administrator user will work. See this and this. Login is mandatory.

Parameters

mongodb_user

Creates a user account in specified database with specified role. In MongoDB database can be absent till some data is written. Users are stored in 'admin' database. To choose appropriate role see built-in roles.

Parameters

mongodb_replicaset

Creates a replica set with specified members (usually 3).

Parameters

mongodb_shard

Add shard to a sharding cluster. This is essentially addShard command. The host parameter can be in any of the following forms:

Parameters

mongodb_sharding_database

Configure sharding for database. This adds enableSharding parameter to database configuration.

Parameters

mongodb_sharding_collection

Enables a collection for sharding and allows MongoDB to begin distributing data among shards. You must run mongodb_sharding_database on a database before using this.

Parameters

mongodb_collection_index

Enables index for collection

Parameters

Examples

If MongoDB is already installed just use

include_recipe 'mongodb3-objects::default'

to install mongo and bson gems. After that LWRPs can be used.

To install standalone MongoDB use

include_recipe 'mongodb3-objects::standalone'

Also you may see examples in fixture cookbook: test/fixtures/cookbooks/mongotest/recipes.

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License & Authors

Copyright:: 2016-2017 Parallels International GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.