Skip to content

Commit

Permalink
add ability to specify name and provider for sensu-plugin package
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 authored and jamtur01 committed Jan 13, 2015
1 parent f1f7273 commit 6f1e9ee
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
## Change Log

### upcoming (2015/01/12 19:01 +00:00)
### v1.4.0 (2015/01/13 09:01 +00:00)
- [#296](https://github.com/sensu/sensu-puppet/pull/296) add ability to specify provider for sensu-plugin package (@jlambert121)
- [dad2ae1](https://github.com/sensu/sensu-puppet/commit/dad2ae1f98edfddc0b9e7a150bf550d38115d183) add ability to specify name and provider for sensu-plugin package (@jlambert121)
- [#285](https://github.com/sensu/sensu-puppet/pull/285) Fixes for dependencies and subscribers properties in sensu::check. (@jonathanio)
- [1cbafe7](https://github.com/sensu/sensu-puppet/commit/1cbafe70c9724db901fc278a397e505eb1e11f4d) Added CHANGELOG generated by https://github.com/lalitkapoor/github-changes (@jamtur01)
- [#295](https://github.com/sensu/sensu-puppet/pull/295) enable travis container environment (@jlambert121)
- [95da534](https://github.com/sensu/sensu-puppet/commit/95da534f580effb29a611bce200856c8f426430e) enable travis container environment (@jlambert121)
- [#294](https://github.com/sensu/sensu-puppet/pull/294) update gemfile (@jlambert121)
- [f1095ae](https://github.com/sensu/sensu-puppet/commit/f1095ae97ddf380ff77b0f1e8e1a0667e3d93bc0) update gemfile (@jlambert121)
- [73dfb0e](https://github.com/sensu/sensu-puppet/commit/73dfb0e7b9da478c2d1655de7a7b6330e544be9b) Fixed Spec tests. (@jonathanio)
- [9532e4b](https://github.com/sensu/sensu-puppet/commit/9532e4b0db2065602cf738c507f00c69b370750f) Set subscribers to under instead of empty array. (@jonathanio)
- [7485d9f](https://github.com/sensu/sensu-puppet/commit/7485d9f0a0e47842a7866458f74237c24a379c20) Fix handling of dependencies property. (@jonathanio)
- [#292](https://github.com/sensu/sensu-puppet/pull/292) fix for future parser (@jlambert121)
- [76906ab](https://github.com/sensu/sensu-puppet/commit/76906aba0f9f9c77dff0b87b0a6a96644e4c680e) fix for future parser (@jlambert121)
- [#287](https://github.com/sensu/sensu-puppet/pull/287) enhance acceptance tests, update spec tests (@jlambert121)
Expand Down Expand Up @@ -308,9 +315,9 @@
- [627590d](https://github.com/sensu/sensu-puppet/commit/627590d0dfe7f724b6ce590533fecae661cb9255) set version on dependencies in Modulefile (@antonlindstrom)
- [#106](https://github.com/sensu/sensu-puppet/pull/106) Several fixes (@LarsFronius)
- [#104](https://github.com/sensu/sensu-puppet/pull/104) fix for issue 102 (@jlambert121)
- [61088be](https://github.com/sensu/sensu-puppet/commit/61088becc17e480cdc4ad08d5a25b452b5407a87) Construct correct yum repo URL with facts
- [41925b7](https://github.com/sensu/sensu-puppet/commit/41925b7d73b4cfa8215fea12d6173d066f9c843a) Don't set empty arrays for subscribers/handlers (@LarsFronius)
- [2b09855](https://github.com/sensu/sensu-puppet/commit/2b098551034cd1a25e6f1b69da34ca4372bd872b) Revert "Construct correct yum repo URL with facts" (@jamtur01)
- [61088be](https://github.com/sensu/sensu-puppet/commit/61088becc17e480cdc4ad08d5a25b452b5407a87) Construct correct yum repo URL with facts
- [ca08502](https://github.com/sensu/sensu-puppet/commit/ca08502b6300765da8b34d6fb9e4bb72811c9991) fix for issue 102 (@jlambert121)
- [c851fd8](https://github.com/sensu/sensu-puppet/commit/c851fd87a0031be4eca1af5f83468461017e0f98) Revert "Construct correct yum repo URL with facts" (@jamtur01)
- [#103](https://github.com/sensu/sensu-puppet/pull/103) Construct correct yum repo URL with facts (@gregmason)
Expand Down
10 changes: 10 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
# Default: latest
# Valid values: absent, installed, latest, present, [\d\.\-]+
#
# [*sensu_plugin_name*]
# String. Name of the sensu-plugin package
# Default: sensu-plugin
#
# [*sensu_plugin_provider*]
# String. Provider used to install the sensu-plugin package
# Default: undef
#
# [*sensu_plugin_version*]
# String. Version of the sensu-plugin gem to install
# Default: absent
Expand Down Expand Up @@ -187,6 +195,8 @@
#
class sensu (
$version = 'latest',
$sensu_plugin_name = 'sensu-plugin',
$sensu_plugin_provider = undef,
$sensu_plugin_version = 'absent',
$install_repo = true,
$repo = 'main',
Expand Down
14 changes: 9 additions & 5 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@
ensure => $sensu::version,
}

$gem_provider = $sensu::use_embedded_ruby ? {
true => 'sensu_gem',
default => 'gem',
if $::sensu::sensu_plugin_provider {
$plugin_provider = $::sensu::sensu_plugin_provider
} else {
$plugin_provider = $sensu::use_embedded_ruby ? {
true => 'sensu_gem',
default => 'gem',
}
}

package { 'sensu-plugin' :
package { $::sensu::sensu_plugin_name :
ensure => $sensu::sensu_plugin_version,
provider => $gem_provider,
provider => $plugin_provider,
}

file { '/etc/default/sensu':
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sensu-sensu",
"version": "1.3.1",
"version": "1.4.0",
"author": "sensu",
"summary": "A module to install the Sensu monitoring framework",
"license": "MIT",
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/sensu_package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@
) }
end

context 'embeded_ruby' do
let(:params) { { :use_embedded_ruby => true } }

it { should contain_package('sensu-plugin').with(:provider => 'sensu_gem') }
end

context 'sensu_plugin_provider and sensu_plugin_name' do
let(:params) { { :sensu_plugin_name => 'rubygem-sensu-plugin', :sensu_plugin_provider => 'rpm' } }

it { should contain_package('rubygem-sensu-plugin').with(:provider => 'rpm') }
end

context 'repos' do

context 'ubuntu' do
Expand Down

0 comments on commit 6f1e9ee

Please sign in to comment.