Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint fixes #283

Merged
merged 1 commit into from
Dec 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manifests/api/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
}

file { '/etc/sensu/conf.d/api.json':
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
}

sensu_api_config { $::fqdn:
Expand Down
10 changes: 5 additions & 5 deletions manifests/check.pp
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@
$check_name = regsubst(regsubst($name, ' ', '_', 'G'), '[\(\)]', '', 'G')

file { "/etc/sensu/conf.d/checks/${check_name}.json":
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
before => Sensu_check[$check_name],
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
before => Sensu_check[$check_name],
}

sensu_check { $check_name:
Expand Down
8 changes: 4 additions & 4 deletions manifests/client/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
}

file { '/etc/sensu/conf.d/client.json':
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
}

sensu_client_config { $::fqdn:
Expand Down
24 changes: 12 additions & 12 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@
# Default: undef
#
define sensu::config (
$ensure = 'present',
$config = undef,
$event = undef,
$ensure = 'present',
$config = undef,
$event = undef,
) {

validate_re($ensure, ['^present$', '^absent$'] )

file { "/etc/sensu/conf.d/checks/config_${name}.json":
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
before => Sensu_check[$name],
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
before => Sensu_check[$name],
}

sensu_check_config { $name:
ensure => $ensure,
config => $config,
event => $event,
notify => Class['sensu::client::service'],
ensure => $ensure,
config => $config,
event => $event,
notify => Class['sensu::client::service'],
}

}
14 changes: 7 additions & 7 deletions manifests/filter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
}

file { "/etc/sensu/conf.d/filters/${name}.json":
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
}

sensu_filter { $name:
ensure => $ensure,
negate => $negate,
attributes => $attributes,
ensure => $ensure,
negate => $negate,
attributes => $attributes,
}

}
52 changes: 26 additions & 26 deletions manifests/handler.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
# [*pipe*]
# Hash. Pipe information used when type=transport
# Keys: name, type, options
# Keys: name, type, options
# Default: undef
#
# [*socket*]
Expand Down Expand Up @@ -116,16 +116,16 @@
$handler = "${install_path}/${filename}"

$file_ensure = $ensure ? {
'absent' => 'absent',
default => 'file'
'absent' => 'absent',
default => 'file'
}

file { $handler:
ensure => $file_ensure,
owner => 'sensu',
group => 'sensu',
mode => '0555',
source => $source,
ensure => $file_ensure,
owner => 'sensu',
group => 'sensu',
mode => '0555',
source => $source,
}

$command_real = $command ? {
Expand All @@ -137,27 +137,27 @@
}

file { "/etc/sensu/conf.d/handlers/${name}.json":
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
before => Sensu_handler[$name],
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
before => Sensu_handler[$name],
}

sensu_handler { $name:
ensure => $ensure,
type => $type,
command => $command_real,
handlers => $handlers,
severities => $severities,
exchange => $exchange,
pipe => $pipe,
socket => $socket,
mutator => $mutator,
filters => $filters,
config => $config,
notify => $notify_services,
require => File['/etc/sensu/conf.d/handlers'],
ensure => $ensure,
type => $type,
command => $command_real,
handlers => $handlers,
severities => $severities,
exchange => $exchange,
pipe => $pipe,
socket => $socket,
mutator => $mutator,
filters => $filters,
config => $config,
notify => $notify_services,
require => File['/etc/sensu/conf.d/handlers'],
}

}
14 changes: 8 additions & 6 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
ensure => $sensu::version,
}

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

package { 'sensu-plugin' :
ensure => $sensu::sensu_plugin_version,
provider => $sensu::use_embedded_ruby ? {
true => 'sensu_gem',
default => 'gem',
}
provider => $gem_provider,
}

file { '/etc/default/sensu':
Expand Down Expand Up @@ -92,8 +94,8 @@
}

group { 'sensu':
ensure => 'present',
system => true,
ensure => 'present',
system => true,
}
}

Expand Down
4 changes: 2 additions & 2 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
'package': {
package { $name:
ensure => $pkg_version
ensure => $pkg_version
}
}
default: {
Expand All @@ -115,10 +115,10 @@
}
# This is to verify the install_dir exists without duplicate declarations
define define_plugins_dir (
$path = $name,
$force,
$purge,
$recurse,
$path = $name,
) {
if ! defined(File[$path]) {
file { $path:
Expand Down
10 changes: 5 additions & 5 deletions manifests/rabbitmq/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
}

file { '/etc/sensu/conf.d/rabbitmq.json':
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
before => Sensu_rabbitmq_config[$::fqdn],
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
before => Sensu_rabbitmq_config[$::fqdn],
}

sensu_rabbitmq_config { $::fqdn:
Expand Down
14 changes: 7 additions & 7 deletions manifests/redis/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
}

file { '/etc/sensu/conf.d/redis.json':
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
}

sensu_redis_config { $::fqdn:
ensure => $ensure,
host => $sensu::redis_host,
port => $sensu::redis_port,
ensure => $ensure,
host => $sensu::redis_host,
port => $sensu::redis_port,
}

}
16 changes: 8 additions & 8 deletions manifests/subscription.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
validate_re($ensure, ['^present$', '^absent$'] )

file { "/etc/sensu/conf.d/subscription_${name}.json":
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
before => Sensu_client_subscription[$name],
ensure => $ensure,
owner => 'sensu',
group => 'sensu',
mode => '0444',
before => Sensu_client_subscription[$name],
}

sensu_client_subscription { $name:
ensure => $ensure,
custom => $custom,
notify => Class['sensu::client::service'],
ensure => $ensure,
custom => $custom,
notify => Class['sensu::client::service'],
}

}
8 changes: 4 additions & 4 deletions tests/sensu-client.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class { 'sensu':
rabbitmq_password => 'correct-horse-battery-staple',
rabbitmq_host => '192.168.56.10',
rabbitmq_password => 'correct-horse-battery-staple',
rabbitmq_host => '192.168.56.10',
rabbitmq_vhost => '/sensu',
subscriptions => 'all',
client_address => "$::ipaddress_eth1",
subscriptions => 'all',
client_address => $::ipaddress_eth1,
}
2 changes: 1 addition & 1 deletion tests/sensu-server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
api => true,
api_user => 'admin',
api_password => 'secret',
client_address => "$::ipaddress_eth1",
client_address => $::ipaddress_eth1,
}

sensu::handler { 'default':
Expand Down