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

Commit 20ce6c6

Browse files
committed
Merge pull request #12 from sunggun-yu/develop
Release v3.0.0
2 parents 6103359 + 6960d9b commit 20ce6c6

File tree

10 files changed

+130
-34
lines changed

10 files changed

+130
-34
lines changed

.kitchen.yml

+40-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ provisioner:
1111

1212
platforms:
1313
- name: ubuntu-12.04
14+
- name: debian-7.8
1415
- name: centos-6.6
15-
- name: centos-5.11
1616
- name: oel-6.6
1717
driver:
1818
box: rafacas/oel66-plain
1919
box_url: https://atlas.hashicorp.com/rafacas/boxes/oel66-plain/versions/1.0.0/providers/virtualbox.box
20+
- name: ami-2014.03
21+
driver:
22+
box_url: http://images.geekandi.com/amazon-linux/vagrant-amazon-linux64-2014.03-public-virtualbox.box
2023

2124
suites:
2225
- name: default
@@ -39,6 +42,7 @@ suites:
3942
environment: dev
4043
excludes:
4144
- oel-6.6
45+
- ami-2014.03
4246

4347
- name: default-305
4448
driver:
@@ -62,6 +66,7 @@ suites:
6266
environment: dev
6367
excludes:
6468
- oel-6.6
69+
- ami-2014.03
6570

6671
- name: replica
6772
driver:
@@ -83,6 +88,7 @@ suites:
8388
environment: dev
8489
excludes:
8590
- oel-6.6
91+
- ami-2014.03
8692

8793
- name: configsvr
8894
driver:
@@ -104,6 +110,7 @@ suites:
104110
environment: dev
105111
excludes:
106112
- oel-6.6
113+
- ami-2014.03
107114

108115
- name: mongos
109116
driver:
@@ -123,6 +130,9 @@ suites:
123130
provisioner:
124131
client_rb:
125132
environment: dev
133+
excludes:
134+
- oel-6.6
135+
- ami-2014.03
126136

127137
- name: wired-tiger
128138
driver:
@@ -144,6 +154,7 @@ suites:
144154
environment: dev
145155
excludes:
146156
- oel-6.6
157+
- ami-2014.03
147158

148159
- name: mms-automation-agent
149160
driver:
@@ -165,6 +176,8 @@ suites:
165176
environment: dev
166177
excludes:
167178
- oel-6.6
179+
- ami-2014.03
180+
- debian-7.8
168181

169182
- name: mms-monitoring-agent
170183
driver:
@@ -185,4 +198,29 @@ suites:
185198
client_rb:
186199
environment: dev
187200
excludes:
188-
- oel-6.6
201+
- oel-6.6
202+
- ami-2014.03
203+
- debian-7.8
204+
205+
- name: ami-default
206+
driver:
207+
vm_hostname: mongo3
208+
run_list:
209+
- recipe[mongodb3::default]
210+
attributes:
211+
mongodb3:
212+
version: 3.0.7
213+
chef_client:
214+
config:
215+
force_logger: true
216+
log_level: info
217+
build-essential:
218+
compile_time: false
219+
provisioner:
220+
client_rb:
221+
environment: dev
222+
excludes:
223+
- ubuntu-12.04
224+
- centos-6.6
225+
- oel-6.6
226+
- debian-7.8

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# mongodb3 Cookbook CHANGELOG
22

3+
## 3.0.0
4+
* Update the default MongoDB package version to 3.0.7
5+
* Update README.md #8
6+
* Make keyserver configurable and fix faraday (berkshelf version bump) #11
7+
* Adding support for Amazon Linux and Debian 7.8 #10
8+
* Removing support for CentOS 5 : It seems like, there is some issue on package that MongoDB provided.
9+
* 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.
10+
11+
NOTICE :
12+
* 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).
13+
* Current version 3.0.0 is not supporting automation and monitoring mms agent installation for Debian 7.8
14+
315
## 2.0.0
416

517
WARNING : `mms-agent` recipe has been deprecated at this version.

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'berkshelf', '~> 3.2.4'
3+
gem 'berkshelf', '~> 4.0.1'
44
gem 'test-kitchen', '~> 1.4.0'
55
gem 'foodcritic', '4.0.0'
66

README.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,46 @@
11
# mongodb3 cookbook
22

3-
WARNING : `mms-agent` recipe has been deprecated.
4-
53
[![Build Status](https://travis-ci.org/sunggun-yu/chef-mongodb3.svg?branch=master)](https://travis-ci.org/sunggun-yu/chef-mongodb3)
64

7-
Install and configure the MongoDB 3.0.x
5+
Install and configure the MongoDB 3
86

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

13+
NOTICE :
14+
* 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).
15+
* Current version 3.0.0 is not supporting automation and monitoring mms agent installation for Debian 7.8
16+
1517
## Supported Platforms
1618

1719
* Ubuntu 12.04, 14.04
18-
* CentOS 5.11, 6.6
20+
* Debian 7.8
21+
* CentOS 6.6
1922
* Oralce 6.6
23+
* Amazon Linux
2024

2125
## Attributes
2226

2327
### Cookbook Attributes
28+
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.
2429

2530
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.
2631

2732
```
2833
# MongoDB version to install
29-
default['mongodb3']['version'] = '3.0.4'
34+
default['mongodb3']['version'] = '3.0.7'
35+
default['mongodb3']['package']['version'] = Actual package version to install. It builds from version attribute.
36+
37+
# Package repository url
38+
default['mongodb3']['package']['repo']['url'] = Package repository url
39+
40+
# Attribute for apt_repository
41+
default['mongodb3']['package']['repo']['apt']['keyserver'] = key server url for ubuntu or debian
42+
default['mongodb3']['package']['repo']['apt']['key'] = '7F0CEB10'
43+
default['mongodb3']['package']['repo']['apt']['components'] = `multiverse` for ubuntu. `main` for debian
3044
3145
# MongoDB user:group : PLEASE DO NOT SET THE USER AND GROUP ATTRIBUTE
3246
default['mongodb3']['user'] = 'mongod' | 'mongodb'

attributes/default.rb

+47-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,39 @@
1818
#
1919

2020
# MongoDB version to install
21-
default['mongodb3']['version'] = '3.0.4'
21+
default['mongodb3']['version'] = '3.0.7'
22+
23+
# Setup default package version attribute to install
24+
pkg_version = node['mongodb3']['version']
25+
case node['platform_family']
26+
when 'rhel', 'fedora'
27+
pkg_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
28+
if node['platform'] == 'amazon'
29+
pkg_version = "#{node['mongodb3']['version']}-1.amzn1" # ~FC019
30+
end
31+
end
32+
33+
# Setup default package repo url attribute for each platform family or platform
34+
case node['platform']
35+
when 'redhat', 'oracle','centos', 'fedora'
36+
pkg_repo = "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
37+
when 'amazon'
38+
pkg_repo = 'https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.0/x86_64/'
39+
when 'ubuntu'
40+
pkg_repo = 'http://repo.mongodb.org/apt/ubuntu'
41+
when 'debian'
42+
pkg_repo = 'http://repo.mongodb.org/apt/debian'
43+
end
44+
45+
# Setup apt variables
46+
case node['platform']
47+
when 'ubuntu'
48+
apt_repo_keyserver = 'hkp://keyserver.ubuntu.com:80'
49+
apt_repo_component = ['multiverse']
50+
when 'debian'
51+
apt_repo_keyserver = 'keyserver.ubuntu.com'
52+
apt_repo_component = ['main']
53+
end
2254

2355
# Default attribute for MongoDB installation
2456
case node['platform_family']
@@ -36,6 +68,17 @@
3668
config_processManagement_fork = nil
3769
end
3870

71+
# MongoDB package repo url
72+
default['mongodb3']['package']['repo']['url'] = pkg_repo
73+
74+
# MongoDB apt keyserver and key
75+
default['mongodb3']['package']['repo']['apt']['keyserver'] = apt_repo_keyserver
76+
default['mongodb3']['package']['repo']['apt']['key'] = '7F0CEB10'
77+
default['mongodb3']['package']['repo']['apt']['components'] = apt_repo_component
78+
79+
# MongoDB package version to install
80+
default['mongodb3']['package']['version'] = pkg_version
81+
3982
# MongoDB user:group
4083
default['mongodb3']['user'] = mongo_user
4184
default['mongodb3']['group'] = mongo_group
@@ -49,6 +92,9 @@
4992
# Key file contents
5093
default['mongodb3']['config']['key_file_content'] = nil
5194

95+
# Key server
96+
default['mongodb3']['keyserver'] = 'hkp://keyserver.ubuntu.com:80'
97+
5298
# Mongod config
5399
# The default value of the attribute is referred to the MongoDB documentation.
54100
# The attribute value of nil will be removed from mongod config file.

metadata.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
license 'Apache 2.0'
55
description 'Installs/Configures mongodb3'
66
long_description 'Installs/Configures mongodb3'
7-
version '2.0.0'
7+
version '3.0.0'
88

99
supports 'ubuntu', '= 12.04'
10+
supports 'debian', '= 7.8'
1011
supports 'redhat', '= 6.6'
1112
supports 'centos', '= 6.6'
1213
supports 'oracle', '= 6.6'
14+
supports 'amazon'
1315

1416
depends 'apt'
1517
depends 'yum'

recipes/default.rb

+1-9
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,9 @@
2222
# Install MongoDB package
2323
install_package = %w(mongodb-org-server mongodb-org-shell mongodb-org-tools)
2424

25-
# Setup package version to install
26-
case node['platform_family']
27-
when 'rhel', 'fedora'
28-
package_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
29-
when 'debian'
30-
package_version = node['mongodb3']['version']
31-
end
32-
3325
install_package.each do |pkg|
3426
package pkg do
35-
version package_version
27+
version node['mongodb3']['package']['version']
3628
action :install
3729
end
3830
end

recipes/mongos.rb

+1-9
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,9 @@
2222
# Install Mongos package
2323
install_package = %w(mongodb-org-shell mongodb-org-mongos mongodb-org-tools)
2424

25-
# Setup package version to install
26-
case node['platform_family']
27-
when 'rhel', 'fedora'
28-
package_version = "#{node['mongodb3']['version']}-1.el#{node.platform_version.to_i}" # ~FC019
29-
when 'debian'
30-
package_version = node['mongodb3']['version']
31-
end
32-
3325
install_package.each do |pkg|
3426
package pkg do
35-
version package_version
27+
version node['mongodb3']['package']['version']
3628
action :install
3729
end
3830
end

recipes/package_repo.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
when 'rhel', 'fedora'
2323
yum_repository 'mongodb-org-3.0' do
2424
description 'MongoDB Repository'
25-
baseurl "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/#{node['kernel']['machine'] =~ /x86_64/ ? 'x86_64' : 'i686'}"
25+
baseurl node['mongodb3']['package']['repo']['url']
2626
action :create
2727
gpgcheck false
2828
enabled true
2929
sslverify false
3030
end
3131
when 'debian'
3232
apt_repository 'mongodb' do
33-
uri 'http://repo.mongodb.org/apt/ubuntu'
33+
uri node['mongodb3']['package']['repo']['url']
3434
distribution "#{node['lsb']['codename']}/mongodb-org/stable"
35-
components ['multiverse']
36-
keyserver 'hkp://keyserver.ubuntu.com:80'
37-
key '7F0CEB10'
35+
components node['mongodb3']['package']['repo']['apt']['components']
36+
keyserver node['mongodb3']['package']['repo']['apt']['keyserver']
37+
key node['mongodb3']['package']['repo']['apt']['key']
3838
action :add
3939
end
4040
include_recipe 'apt'

test/integration/default/serverspec/default_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@
5353

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

0 commit comments

Comments
 (0)