Skip to content

Commit

Permalink
fix issue MODULES-5545
Browse files Browse the repository at this point in the history
  • Loading branch information
bovy89 committed Aug 28, 2017
1 parent 7d946e7 commit bbfbfc5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'x86_64' => "http://repo.mongodb.org/yum/redhat/${::operatingsystemmajrelease}/mongodb-org/${mongover[0]}.${mongover[1]}/x86_64/",
default => undef
}
$description = 'MongoDB Repository'
}
else {
$location = $::architecture ? {
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
it { expect { is_expected.to raise_error(Puppet::Error) } }
end

context "when deploying on RedHat with version >= 3.0" do
with_redhat_facts
let(:pre_condition) do
"class { 'mongodb::globals':
version => '3.4.7-1.el7',
manage_package_repo => true,
}"
end
it { is_expected.to contain_package('mongodb-org-server').with(
:version => '3.4.7-1.el7',
)}
end

context 'setting nohttpinterface' do
it "isn't set when undef" do
is_expected.to_not contain_file('/etc/mongodb.conf').with_content(/nohttpinterface/)
Expand Down
11 changes: 6 additions & 5 deletions spec/spec_helper_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ def with_centos_facts
def with_redhat_facts
let :facts do
{
:architecture => 'x86_64',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.0',
:osfamily => 'RedHat',
:root_home => '/root',
:architecture => 'x86_64',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.0',
:operatingsystemmajrelease => '7',
:osfamily => 'RedHat',
:root_home => '/root',
}
end
end

0 comments on commit bbfbfc5

Please sign in to comment.