-
-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from hogepodge/client
Adds client installation support for RHEL systems
- Loading branch information
Showing
15 changed files
with
194 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Class for installing a MongoDB client shell (CLI). | ||
# | ||
# == Parameters | ||
# | ||
# [ensure] Desired ensure state of the package. Optional. | ||
# Defaults to 'true' | ||
# | ||
# [package_name] Name of the package to install the client from. Default | ||
# is repository dependent. | ||
# | ||
class mongodb::client ( | ||
$ensure = $mongodb::params::ensure_client, | ||
$package_name = $mongodb::params::client_package_name, | ||
) inherits mongodb::params { | ||
case $::osfamily { | ||
'RedHat', 'Linux': { | ||
class { 'mongodb::client::install': } | ||
} | ||
'Debian': { | ||
warning ('Debian client is included by default with server. Please use ::mongodb::server to install the mongo client for Debian family systems.') | ||
} | ||
default: { | ||
# no action taken, failure happens in params.pp | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# PRIVATE CLASS: do not call directly | ||
class mongodb::client::install { | ||
$package_ensure = $mongodb::client::ensure | ||
$package_name = $mongodb::client::package_name | ||
|
||
case $package_ensure { | ||
true: { | ||
$my_package_ensure = 'present' | ||
} | ||
false: { | ||
$my_package_ensure = 'purged' | ||
} | ||
'absent': { | ||
$my_package_ensure = 'purged' | ||
} | ||
default: { | ||
$my_package_ensure = $package_ensure | ||
} | ||
} | ||
|
||
package { 'mongodb_client': | ||
ensure => $my_package_ensure, | ||
name => $package_name, | ||
tag => 'mongodb', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'spec_helper' | ||
|
||
describe 'mongodb::client::install', :type => :class do | ||
describe 'it should create package' do | ||
let(:pre_condition) { ["class mongodb::client { $ensure = true $package_name = 'mongodb' }", "include mongodb::client"]} | ||
it { | ||
should contain_package('mongodb_client').with({ | ||
:ensure => 'present', | ||
:name => 'mongodb', | ||
}) | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.