Skip to content

Commit 9faae00

Browse files
committed
Update mongodb to 3bcfc75229c4faffe5ccfe9caf1278a54ef0f7cc
3bcfc75229c4faffe5ccfe9caf1278a54ef0f7cc Merge pull request redhat-openstack#237 from erikanderson/normalize_template_spacing 38ceb81e36bbbb844039e12fb8aebb43cb2cef0d Merge pull request redhat-openstack#232 from GoozeyX/squashed_forpull 2537fc4dc770c1e1a46567691aa7e7f76961fb52 added yum proxy options 9b9f7571aed4401197437659b31d8d5ac3849e4e Normalize spacing in template Change-Id: I8a0eed4d5951ab63e8c96672e409dcf514876739
1 parent da44b07 commit 9faae00

8 files changed

Lines changed: 61 additions & 12 deletions

File tree

Puppetfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ mod 'module-data',
143143
:git => 'https://github.com/ripienaar/puppet-module-data.git'
144144

145145
mod 'mongodb',
146-
:commit => 'a5d6e5d36fb1007534bca85fd277a678e6c5a2ee',
146+
:commit => '3bcfc75229c4faffe5ccfe9caf1278a54ef0f7cc',
147147
:git => 'https://github.com/puppetlabs/puppetlabs-mongodb.git'
148148

149149
mod 'mysql',

mongodb/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Unreleased
2+
### Summary
3+
- support setting a proxy for yum repositories with or without user/password authentication
4+
15
## 2015-06-22 - Release 0.11.0
26
### Summary
37

mongodb/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,15 @@ the module will use the default for your OS distro.
232232
This setting can be used to override the default MongoDB repository location.
233233
If not specified, the module will use the default repository for your OS distro.
234234

235+
#####`repo_proxy`
236+
This will allow you to set a proxy for your repository in case you are behind a corporate firewall. Currently this is only supported with yum repositories
237+
238+
#####`proxy_username`
239+
This sets the username for the proxyserver, should authentication be required
240+
241+
#####`proxy_password`
242+
This sets the password for the proxyserver, should authentication be required
243+
235244
####Class: mongodb::server
236245

237246
Most of the parameters manipulate the mongod.conf file.

mongodb/manifests/globals.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
$manage_package_repo = undef,
2929
$manage_package = undef,
30+
$repo_proxy = undef,
31+
$proxy_username = undef,
32+
$proxy_password = undef,
3033

3134
$repo_location = undef,
3235
$use_enterprise_repo = undef,
@@ -39,6 +42,7 @@
3942
class { '::mongodb::repo':
4043
ensure => present,
4144
repo_location => $repo_location,
45+
proxy => $repo_proxy,
4246
}
4347
}
4448
}

mongodb/manifests/repo.pp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# PRIVATE CLASS: do not use directly
22
class mongodb::repo (
3-
$ensure = $mongodb::params::ensure,
4-
$version = $mongodb::params::version,
5-
$repo_location = undef,
3+
$ensure = $mongodb::params::ensure,
4+
$version = $mongodb::params::version,
5+
$repo_location = undef,
6+
$proxy = undef,
7+
$proxy_username = undef,
8+
$proxy_password = undef,
69
) inherits mongodb::params {
710
case $::osfamily {
811
'RedHat', 'Linux': {

mongodb/manifests/repo/yum.pp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55

66
if($::mongodb::repo::ensure == 'present' or $::mongodb::repo::ensure == true) {
77
yumrepo { 'mongodb':
8-
descr => $::mongodb::repo::description,
9-
baseurl => $::mongodb::repo::location,
10-
gpgcheck => '0',
11-
enabled => '1',
8+
descr => $::mongodb::repo::description,
9+
baseurl => $::mongodb::repo::location,
10+
gpgcheck => '0',
11+
enabled => '1',
12+
proxy => $::mongodb::repo::proxy,
13+
proxy_username => $::mongodb::repo::proxy_username,
14+
proxy_password => $::mongodb::repo::proxy_password,
1215
}
1316
Yumrepo['mongodb'] -> Package<|tag == 'mongodb'|>
1417
}

mongodb/spec/classes/repo_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,30 @@
2929
}
3030
end
3131

32+
context 'when yumrepo has a proxy set' do
33+
let :facts do
34+
{
35+
:osfamily => 'RedHat',
36+
:operatingsystem => 'RedHat',
37+
}
38+
end
39+
let :params do
40+
{
41+
:proxy => 'http://proxy-server:8080',
42+
:proxy_username => 'proxyuser1',
43+
:proxy_password => 'proxypassword1',
44+
}
45+
end
46+
it {
47+
is_expected.to contain_class('mongodb::repo::yum')
48+
}
49+
it do
50+
should contain_yumrepo('mongodb').with({
51+
'enabled' => '1',
52+
'proxy' => 'http://proxy-server:8080',
53+
'proxy_username' => 'proxyuser1',
54+
'proxy_password' => 'proxypassword1',
55+
})
56+
end
57+
end
3258
end

mongodb/templates/mongodb.conf.2.6.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# mongo.conf - generated from Puppet
1+
#mongo.conf - generated from Puppet
22

3-
# System Log
3+
#System Log
44

55
<% if @logpath -%>
66
systemLog.path: <%= @logpath %>
@@ -80,7 +80,7 @@ security.javascriptEnabled: <%= @noscripting %>
8080
<% end -%>
8181

8282

83-
# Net
83+
#Net
8484
<% if @ipv6 -%>
8585
net.ipv6=<%= @ipv6 %>
8686
<% end -%>
@@ -111,7 +111,7 @@ replication.replSetName: <%= @replset %>
111111
replication.oplogSizeMB: <%= @oplog_size %>
112112
<% end -%>
113113

114-
# Sharding
114+
#Sharding
115115
<% if @configsvr -%>
116116
sharding.clusterRole: configsvr
117117
<% end -%>

0 commit comments

Comments
 (0)