Skip to content

Commit 38a51ec

Browse files
committed
Merge pull request voxpupuli#266 from Poil/mongodb3.x
Add mongodb 3.x on Debian/Ubuntu
2 parents f48fc81 + 7054066 commit 38a51ec

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

manifests/repo.pp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,37 @@
3939
'Debian': {
4040
if ($repo_location != undef){
4141
$location = $repo_location
42-
}else{
42+
}
43+
elsif $version and (versioncmp($version, '3.0.0') >= 0) {
44+
$mongover = split($version, '[.]')
45+
$location = $::operatingsystem ? {
46+
'Debian' => 'https://repo.mongodb.org/apt/debian',
47+
'Ubuntu' => 'https://repo.mongodb.org/apt/ubuntu',
48+
default => undef
49+
}
50+
# Temp hack. Need to follow https://jira.mongodb.org/browse/SERVER-18329
51+
if ($::lsbdistcodename == 'jessie') {
52+
$release = "wheezy/mongodb-org/${mongover[0]}.${mongover[1]}"
53+
} else {
54+
$release = "${::lsbdistcodename}/mongodb-org/${mongover[0]}.${mongover[1]}"
55+
}
56+
$repos = $::operatingsystem ? {
57+
'Debian' => 'main',
58+
'Ubuntu' => 'multiverse',
59+
default => undef
60+
}
61+
$key = '492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10'
62+
$key_server = 'hkp://keyserver.ubuntu.com:80'
63+
} else {
4364
$location = $::operatingsystem ? {
4465
'Debian' => 'http://downloads-distro.mongodb.org/repo/debian-sysvinit',
4566
'Ubuntu' => 'http://downloads-distro.mongodb.org/repo/ubuntu-upstart',
4667
default => undef
4768
}
69+
$release = 'dist'
70+
$repos = '10gen'
71+
$key = '492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10'
72+
$key_server = 'hkp://keyserver.ubuntu.com:80'
4873
}
4974
class { '::mongodb::repo::apt': }
5075
}

manifests/repo/apt.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
if($::mongodb::repo::ensure == 'present' or $::mongodb::repo::ensure == true) {
99
apt::source { 'mongodb':
1010
location => $::mongodb::repo::location,
11-
release => 'dist',
12-
repos => '10gen',
13-
key => '492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10',
14-
key_server => 'hkp://keyserver.ubuntu.com:80',
11+
release => $::mongodb::repo::release,
12+
repos => $::mongodb::repo::repos,
13+
key => $::mongodb::repo::key,
14+
key_server => $::mongodb::repo::key_server,
1515
include_src => false,
1616
}
1717

0 commit comments

Comments
 (0)