Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #12 from sunggun-yu/develop
Browse files Browse the repository at this point in the history
Release v3.0.0
  • Loading branch information
sunggun-yu committed Nov 15, 2015
2 parents 6103359 + 6960d9b commit 20ce6c6
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 34 deletions.
42 changes: 40 additions & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ provisioner:

platforms:
- name: ubuntu-12.04
- name: debian-7.8
- name: centos-6.6
- name: centos-5.11
- name: oel-6.6
driver:
box: rafacas/oel66-plain
box_url: https://atlas.hashicorp.com/rafacas/boxes/oel66-plain/versions/1.0.0/providers/virtualbox.box
- name: ami-2014.03
driver:
box_url: http://images.geekandi.com/amazon-linux/vagrant-amazon-linux64-2014.03-public-virtualbox.box

suites:
- name: default
Expand All @@ -39,6 +42,7 @@ suites:
environment: dev
excludes:
- oel-6.6
- ami-2014.03

- name: default-305
driver:
Expand All @@ -62,6 +66,7 @@ suites:
environment: dev
excludes:
- oel-6.6
- ami-2014.03

- name: replica
driver:
Expand All @@ -83,6 +88,7 @@ suites:
environment: dev
excludes:
- oel-6.6
- ami-2014.03

- name: configsvr
driver:
Expand All @@ -104,6 +110,7 @@ suites:
environment: dev
excludes:
- oel-6.6
- ami-2014.03

- name: mongos
driver:
Expand All @@ -123,6 +130,9 @@ suites:
provisioner:
client_rb:
environment: dev
excludes:
- oel-6.6
- ami-2014.03

- name: wired-tiger
driver:
Expand All @@ -144,6 +154,7 @@ suites:
environment: dev
excludes:
- oel-6.6
- ami-2014.03

- name: mms-automation-agent
driver:
Expand All @@ -165,6 +176,8 @@ suites:
environment: dev
excludes:
- oel-6.6
- ami-2014.03
- debian-7.8

- name: mms-monitoring-agent
driver:
Expand All @@ -185,4 +198,29 @@ suites:
client_rb:
environment: dev
excludes:
- oel-6.6
- oel-6.6
- ami-2014.03
- debian-7.8

- name: ami-default
driver:
vm_hostname: mongo3
run_list:
- recipe[mongodb3::default]
attributes:
mongodb3:
version: 3.0.7
chef_client:
config:
force_logger: true
log_level: info
build-essential:
compile_time: false
provisioner:
client_rb:
environment: dev
excludes:
- ubuntu-12.04
- centos-6.6
- oel-6.6
- debian-7.8
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# mongodb3 Cookbook CHANGELOG

## 3.0.0
* Update the default MongoDB package version to 3.0.7
* Update README.md #8
* Make keyserver configurable and fix faraday (berkshelf version bump) #11
* Adding support for Amazon Linux and Debian 7.8 #10
* Removing support for CentOS 5 : It seems like, there is some issue on package that MongoDB provided.
* Removing kitchen test of mongos for oel-6.6 : There was no 3.0.7-1.el6 of mongos package for Oracle Linux 6.6 (Test failure). I'll keep testing and bring it back later.

NOTICE :
* Current version 3.0.0 is not supporting mongos 3.0.7 for Oracle Linux 6.6. The package version 3.0.7-1.el6 of mongodb-org-shell package wasn't existing (Test failure).
* Current version 3.0.0 is not supporting automation and monitoring mms agent installation for Debian 7.8

## 2.0.0

WARNING : `mms-agent` recipe has been deprecated at this version.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'berkshelf', '~> 3.2.4'
gem 'berkshelf', '~> 4.0.1'
gem 'test-kitchen', '~> 1.4.0'
gem 'foodcritic', '4.0.0'

Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
# mongodb3 cookbook

WARNING : `mms-agent` recipe has been deprecated.

[![Build Status](https://travis-ci.org/sunggun-yu/chef-mongodb3.svg?branch=master)](https://travis-ci.org/sunggun-yu/chef-mongodb3)

Install and configure the MongoDB 3.0.x
Install and configure the MongoDB 3

* Install and configure the mongod (or configure the config server for shard cluster)
* Install and configure the mongos
* Also, mongos configure the mongos service with runit : `service mongos start|stop|restart|status`
* Install the MMS Automation Agent
* Install the MMS Monitoring Agent

NOTICE :
* Current version 3.0.0 is not supporting mongos 3.0.7 for Oracle Linux 6.6. The package version 3.0.7-1.el6 of mongodb-org-shell package wasn't existing (Test failure).
* Current version 3.0.0 is not supporting automation and monitoring mms agent installation for Debian 7.8

## Supported Platforms

* Ubuntu 12.04, 14.04
* CentOS 5.11, 6.6
* Debian 7.8
* CentOS 6.6
* Oralce 6.6
* Amazon Linux

## Attributes

### Cookbook Attributes
mongodb3 cookbook uses the package installation of mongodb3 such as yum or apt. and these attributes are used for setting default values in order to provide the correct installation of mongodb3. typically, you can modify cookbook attributes if you need. however, I do not recommend to modify these attributes if you want to use package that is provided from MongoDB.

WARNING : Please do not set the user and group attribute on your side. This cook book let installing user and group by mongodb package (except `mongos` and `mms-monitoring-agent` recipe). The user and group name will be set by condition in default attribute because mongodb package installs different user and group name by platform.

```
# MongoDB version to install
default['mongodb3']['version'] = '3.0.4'
default['mongodb3']['version'] = '3.0.7'
default['mongodb3']['package']['version'] = Actual package version to install. It builds from version attribute.
# Package repository url
default['mongodb3']['package']['repo']['url'] = Package repository url
# Attribute for apt_repository
default['mongodb3']['package']['repo']['apt']['keyserver'] = key server url for ubuntu or debian
default['mongodb3']['package']['repo']['apt']['key'] = '7F0CEB10'
default['mongodb3']['package']['repo']['apt']['components'] = `multiverse` for ubuntu. `main` for debian
# MongoDB user:group : PLEASE DO NOT SET THE USER AND GROUP ATTRIBUTE
default['mongodb3']['user'] = 'mongod' | 'mongodb'
Expand Down
48 changes: 47 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,39 @@
#

# MongoDB version to install
default['mongodb3']['version'] = '3.0.4'
default['mongodb3']['version'] = '3.0.7'

# Setup default package version attribute to install
pkg_version = node['mongodb3']['version']
case node['platform_family']
when 'rhel', 'fedora'
pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
if node['platform'] == 'amazon'
pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019
end
end

# Setup default package repo url attribute for each platform family or platform
case node['platform']
when 'redhat', 'oracle','centos', 'fedora'
pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
when 'amazon'
pkg_repo = 'https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.0/x86_64/'
when 'ubuntu'
pkg_repo = 'http://repo.mongodb.org/apt/ubuntu'
when 'debian'
pkg_repo = 'http://repo.mongodb.org/apt/debian'
end

# Setup apt variables
case node['platform']
when 'ubuntu'
apt_repo_keyserver = 'hkp://keyserver.ubuntu.com:80'
apt_repo_component = ['multiverse']
when 'debian'
apt_repo_keyserver = 'keyserver.ubuntu.com'
apt_repo_component = ['main']
end

# Default attribute for MongoDB installation
case node['platform_family']
Expand All @@ -36,6 +68,17 @@
config_processManagement_fork = nil
end

# MongoDB package repo url
default['mongodb3']['package']['repo']['url'] = pkg_repo

# MongoDB apt keyserver and key
default['mongodb3']['package']['repo']['apt']['keyserver'] = apt_repo_keyserver
default['mongodb3']['package']['repo']['apt']['key'] = '7F0CEB10'
default['mongodb3']['package']['repo']['apt']['components'] = apt_repo_component

# MongoDB package version to install
default['mongodb3']['package']['version'] = pkg_version

# MongoDB user:group
default['mongodb3']['user'] = mongo_user
default['mongodb3']['group'] = mongo_group
Expand All @@ -49,6 +92,9 @@
# Key file contents
default['mongodb3']['config']['key_file_content'] = nil

# Key server
default['mongodb3']['keyserver'] = 'hkp://keyserver.ubuntu.com:80'

# Mongod config
# The default value of the attribute is referred to the MongoDB documentation.
# The attribute value of nil will be removed from mongod config file.
Expand Down
4 changes: 3 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
license 'Apache 2.0'
description 'Installs/Configures mongodb3'
long_description 'Installs/Configures mongodb3'
version '2.0.0'
version '3.0.0'

supports 'ubuntu', '= 12.04'
supports 'debian', '= 7.8'
supports 'redhat', '= 6.6'
supports 'centos', '= 6.6'
supports 'oracle', '= 6.6'
supports 'amazon'

depends 'apt'
depends 'yum'
Expand Down
10 changes: 1 addition & 9 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,9 @@
# Install MongoDB package
install_package = %w(mongodb-org-server mongodb-org-shell mongodb-org-tools)

# Setup package version to install
case node['platform_family']
when 'rhel', 'fedora'
package_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
when 'debian'
package_version = node['mongodb3']['version']
end

install_package.each do |pkg|
package pkg do
version package_version
version node['mongodb3']['package']['version']
action :install
end
end
Expand Down
10 changes: 1 addition & 9 deletions recipes/mongos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,9 @@
# Install Mongos package
install_package = %w(mongodb-org-shell mongodb-org-mongos mongodb-org-tools)

# Setup package version to install
case node['platform_family']
when 'rhel', 'fedora'
package_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
when 'debian'
package_version = node['mongodb3']['version']
end

install_package.each do |pkg|
package pkg do
version package_version
version node['mongodb3']['package']['version']
action :install
end
end
Expand Down
10 changes: 5 additions & 5 deletions recipes/package_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
when 'rhel', 'fedora'
yum_repository 'mongodb-org-3.0' do
description 'MongoDB Repository'
baseurl "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
baseurl node['mongodb3']['package']['repo']['url']
action :create
gpgcheck false
enabled true
sslverify false
end
when 'debian'
apt_repository 'mongodb' do
uri 'http://repo.mongodb.org/apt/ubuntu'
uri node['mongodb3']['package']['repo']['url']
distribution "#{node['lsb']['codename']}/mongodb-org/stable"
components ['multiverse']
keyserver 'hkp://keyserver.ubuntu.com:80'
key '7F0CEB10'
components node['mongodb3']['package']['repo']['apt']['components']
keyserver node['mongodb3']['package']['repo']['apt']['keyserver']
key node['mongodb3']['package']['repo']['apt']['key']
action :add
end
include_recipe 'apt'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@

# Test mongod process starts with expected mongodb config file
describe command('mongo --eval "db.version()"') do
its(:stdout) { should contain('3.0.4') }
its(:stdout) { should contain('3.0.7') }
end

0 comments on commit 20ce6c6

Please sign in to comment.