Skip to content

Commit

Permalink
polish dashboard config & service mgmt
Browse files Browse the repository at this point in the history
re PR sensu#401 among other things
  • Loading branch information
David Gwilliam committed Aug 18, 2015
1 parent 80b59da commit 4b5cddc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions manifests/enterprise/dashboard/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

if $sensu::purge_config and !$sensu::enterprise_dashboard {
$ensure = 'absent'
if $sensu::purge and !$sensu::enterprise_dashboard {
if is_hash($sensu::purge) and $::sensu::purge['config'] {
$ensure = 'absent'
} else {
$ensure = 'present'
}
} else {
$ensure = 'present'
}

if $ensure == 'present' {
$_ensure = 'file'
} else {
$_ensure = $ensure
}

file { '/etc/sensu/dashboard.json':
ensure => file,
ensure => $_ensure,
owner => 'sensu',
group => 'sensu',
mode => '0440',
Expand Down
2 changes: 1 addition & 1 deletion manifests/enterprise/dashboard/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

if $::sensu::manage_services and $::sensu::enterprise_dashboard {
if $::sensu::manage_services {
case $::sensu::enterprise_dashboard {
true: {
$ensure = 'running'
Expand Down

0 comments on commit 4b5cddc

Please sign in to comment.