Skip to content

Commit

Permalink
Remove dashboard management
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Aug 12, 2014
1 parent eaab2ce commit 23741ed
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 363 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Debian & Ubuntu:
class { 'sensu':
rabbitmq_password => 'secret',
server => true,
dashboard => true,
api => true,
plugins => [
'puppet:///data/sensu/plugins/ntp.rb',
Expand Down Expand Up @@ -97,8 +96,6 @@ and configures Sensu on each individual node via

### common.yaml

sensu::dashboard_port: 8090
sensu::dashboard_password: mysupersecretpassword
sensu::install_repo: false
sensu::purge_config: true
sensu::rabbitmq_host: 10.31.0.90
Expand Down Expand Up @@ -135,13 +132,12 @@ A usage example is shown below.
### Sensu server

Each component of Sensu can be controlled separately. The server components
are managed with the server, dashboard, and API parameters.
are managed with the server, and API parameters.

node 'sensu-server.foo.com' {
class { 'sensu':
rabbitmq_password => 'secret',
server => true,
dashboard => true,
api => true,
plugins => [
'puppet:///data/sensu/plugins/ntp.rb',
Expand Down Expand Up @@ -295,6 +291,11 @@ apache/manifests/service.pp
'nagios': { include apache::monitoring::nagios }
}

## Dashboards

The following puppet modules exist for managing dashboards

* [uchiwa](https://github.com/pauloconnor/pauloconnor-uchiwa)

## License

Expand Down
84 changes: 0 additions & 84 deletions lib/puppet/provider/sensu_dashboard_config/json.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/puppet/type/sensu_api_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ def initialize(*args)

self[:notify] = [
"Service[sensu-api]",
"Service[sensu-dashboard]",
].select { |ref| catalog.resource(ref) }
end

Expand Down
63 changes: 0 additions & 63 deletions lib/puppet/type/sensu_dashboard_config.rb

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/api/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

if $sensu::purge_config and !$sensu::server and !$sensu::api and !$sensu::dashboard {
if $sensu::purge_config and !$sensu::server and !$sensu::api {
$ensure = 'absent'
} else {
$ensure = 'present'
Expand Down
35 changes: 0 additions & 35 deletions manifests/dashboard/config.pp

This file was deleted.

31 changes: 0 additions & 31 deletions manifests/dashboard/service.pp

This file was deleted.

32 changes: 1 addition & 31 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
# Default: false
# Valid values: true, false
#
# [*dashboard*]
# Boolean. Include the sensu dashboard service
# Default: false
# Valid values: true, false
#
# [*manage_services*]
# Boolean. Manage the sensu services with puppet
# Default: true
Expand Down Expand Up @@ -123,22 +118,6 @@
# Integer. Password of the sensu api service
# Default: undef
#
# [*dashboard_host*]
# String. Hostname of the dahsboard host
# Default: $::ipaddress
#
# [*dashboard_port*]
# Integer. Port for the sensu dashboard
# Default: 8080
#
# [*dashboard_user*]
# String. Username to access the dashboard service
# Default: admin
#
# [*dashboard_password*]
# String. Password for dashboard_user
# Default: secret
#
# [*subscriptions*]
# Array of strings. Default suscriptions used by the client
# Default: []
Expand Down Expand Up @@ -194,7 +173,6 @@
$client = true,
$server = false,
$api = false,
$dashboard = false,
$manage_services = true,
$manage_user = true,
$rabbitmq_port = 5672,
Expand All @@ -211,11 +189,6 @@
$api_port = 4567,
$api_user = undef,
$api_password = undef,
$dashboard_bind = '0.0.0.0',
$dashboard_host = $::ipaddress,
$dashboard_port = 8080,
$dashboard_user = 'admin',
$dashboard_password = 'secret',
$subscriptions = [],
$client_bind = '127.0.0.1',
$client_address = $::ipaddress,
Expand All @@ -229,7 +202,7 @@
$log_level = 'info',
){

validate_bool($client, $server, $api, $dashboard, $install_repo, $purge_config, $safe_mode, $manage_services)
validate_bool($client, $server, $api, $install_repo, $purge_config, $safe_mode, $manage_services)

validate_re($repo, ['^main$', '^unstable$'], "Repo must be 'main' or 'unstable'. Found: ${repo}")
validate_re($version, ['^absent$', '^installed$', '^latest$', '^present$', '^[\d\.\-]+$'], "Invalid package version: ${version}")
Expand All @@ -238,7 +211,6 @@
if !is_integer($rabbitmq_port) { fail('rabbitmq_port must be an integer') }
if !is_integer($redis_port) { fail('redis_port must be an integer') }
if !is_integer($api_port) { fail('api_port must be an integer') }
if !is_integer($dashboard_port) { fail('dashboard_port must be an integer') }

# Ugly hack for notifications, better way?
# Put here to avoid computing the conditionals for every check
Expand Down Expand Up @@ -269,11 +241,9 @@
class { 'sensu::api::config': } ->
class { 'sensu::redis::config': } ->
class { 'sensu::client::config': } ->
class { 'sensu::dashboard::config': } ->
class { 'sensu::client::service': } ->
class { 'sensu::api::service': } ->
class { 'sensu::server::service': } ->
class { 'sensu::dashboard::service': } ->
anchor {'sensu::end': }

sensu::plugin { $plugins: install_path => '/etc/sensu/plugins'}
Expand Down
2 changes: 1 addition & 1 deletion manifests/redis/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
fail("Use of private class ${name} by ${caller_module_name}")
}

if $sensu::purge_config and !$sensu::server and !$sensu::api and !$sensu::dashboard {
if $sensu::purge_config and !$sensu::server and !$sensu::api {
$ensure = 'absent'
} else {
$ensure = 'present'
Expand Down
7 changes: 0 additions & 7 deletions spec/classes/sensu_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@
it { should contain_file('/etc/sensu/conf.d/api.json').with_ensure('present') }
end

context 'wtih dashboard' do
let(:params) { { :dashboard => true } }
it { should contain_file('/etc/sensu/conf.d/api.json').with_ensure('present') }
end

context 'purge config' do
let(:params) { {
:purge_config => true,
:server => false,
:dashboard => false
} }

it { should contain_file('/etc/sensu/conf.d/api.json').with_ensure('absent') }
Expand Down Expand Up @@ -98,7 +92,6 @@
:purge_config => true,
:api => false,
:server => false,
:dashboard => false,
} }

it { should contain_file('/etc/sensu/conf.d/api.json').with_ensure('absent') }
Expand Down
Loading

0 comments on commit 23741ed

Please sign in to comment.