Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

mongodb3-objects (4) Versions 0.4.5

Provides LWRP resources to manage MongoDB 3.x

Policyfile
Berkshelf
Knife
cookbook 'mongodb3-objects', '= 0.4.5', :supermarket
cookbook 'mongodb3-objects', '= 0.4.5'
knife supermarket install mongodb3-objects
knife supermarket download mongodb3-objects
README
Dependencies
Changelog
Quality 43%

mongodb3-objects

Cookbook Version

Description

This cookbook is a wrapper over the mongodb3 cookbook. It contains LWRP resources to create:
* users
* replica sets
* sharding database
* sharding collection
* replica sets for config servers
* routing servers (mongos)

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
  • login - Login name for administrator account
  • password - Password for administrator account

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
  • login - Login name for administrator account
  • password - Password for administrator account
  • roles - Roles to assign
  • database - User database

mongodb_replicaset

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

Parameters
  • members - Replica set members in format [{"host": "host1:port"}, {"host": "host2:port", "priority": 2}]
  • config_server - Set config server settings for replica set

mongodb_shard

Add shard to a sharding cluster. This is essentially addShard command. The host parameter can be in any of the following forms:
- [hostname]
- [hostname]:[port]
- [replica-set-name]/[hostname]
- [replica-set-name]/[hostname]:port

Parameters
  • shard_endpoint - The hostname of either a standalone database instance or of a replica set. Include the port number if the instance is running on a non-standard port. Include the replica set name if the instance is a replica set.

mongodb_sharding_database

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

Parameters
  • database - Database name

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
  • collection - Collection name
  • shard_key - The index specification document to use as the shard key. The index must exist prior to the shardCollection command, unless the collection is empty. If the collection is empty, in which case MongoDB creates the index prior to sharding the collection. New in version 2.4: The key may be in the form { field : "hashed" }, which will use the specified field as a hashed shard key.

mongodb_collection_index

Enables index for collection

Parameters
  • collection - Collection name
  • database - Database name
  • index - Index description

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.

Dependent cookbooks

mongodb3 >= 0.0.0
mongo_chef_gem >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

0.4.5 (Jan 18, 2017)

  • Release to community

0.4.4 (Sep 13, 2016)

  • Add mongodb_collection_index LWRP

0.4.3 (Sep 13, 2016)

  • Update logging to warn

0.4.0 (May 30, 2016)

  • Change LWRP mongo_replicaset

0.3.1 (May 19, 2016)

  • Now resources fail hard if creation didn't succeed.

0.3.0 (May 18, 2016)

  • Add support to add replica set through mongodb_shard resource. This breaks backward compatibility for this resource!
  • Add Centos 7 to converge and verify platforms.

0.2.2 (April 14, 2016)

  • Fix roles for mongodb_admin resource.

0.2.0 (April 12, 2016)

  • Add replica set LWRP with tests;
  • Add sharding LWRPs.

0.1.0 (March 24, 2016)

  • Initial cookbook.

Collaborator Number Metric
            

0.4.5 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.4.5 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.4.5 failed this metric

FC008: Generated cookbook metadata needs updating: mongodb3-objects/metadata.rb:2
FC066: Ensure chef_version is set in metadata: mongodb3-objects/metadata.rb:1
FC069: Ensure standardized license defined in metadata: mongodb3-objects/metadata.rb:1
FC108: Resource should not define a property named 'name': mongodb3-objects/resources/mongodb_collection_index.rb:22
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_collection_index.rb:22
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_collection_index.rb:23
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_collection_index.rb:24
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_collection_index.rb:25
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_shard.rb:22
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_sharding_collection.rb:22
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_sharding_collection.rb:23
FC117: Do not use kind_of in custom resource properties: mongodb3-objects/resources/mongodb_sharding_database.rb:22
FC118: Resource property setting name_attribute vs. name_property: mongodb3-objects/resources/mongodb_collection_index.rb:22
FC118: Resource property setting name_attribute vs. name_property: mongodb3-objects/resources/mongodb_shard.rb:22
FC118: Resource property setting name_attribute vs. name_property: mongodb3-objects/resources/mongodb_sharding_collection.rb:22
FC118: Resource property setting name_attribute vs. name_property: mongodb3-objects/resources/mongodb_sharding_database.rb:22
Run with Foodcritic Version 13.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.4.5 passed this metric

No Binaries Metric
            

0.4.5 passed this metric

Testing File Metric
            

0.4.5 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.4.5 passed this metric