forked from sensu/sensu-puppet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed anchors and create_resources Syntax fix Added forgotten defaults var in init.pp resource hashes Fixed order in hash merging Remove check for private classes usage sensu::enterpise::dashboard class consolidation sensu#709 Removed subclasses incorporated in sensu::enterprise::dashboard Fixed sensu::check notify tests Removed manifests readded by merge Workaround for Puppet 4.x compatibilty - Evaluation Error: Error while evaluating a Resource Statement, Sensu::Write_json[/etc/sensu/conf.d/checks/mycheck.json]: parameter 'notify_list' index 0 expects a Data value, got Type at /home/travis/build/sensu/sensu-puppet/spec/fixtures/modules/sensu/manifests/check.pp:226 on node testing-docker-0c136c1e-7d4c-4d32-9c4c-37325d83735a.ec2.internal
- Loading branch information
Showing
29 changed files
with
318 additions
and
414 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# = Class: sensu::api | ||
# | ||
# Manages the Sensu api | ||
# | ||
# == Parameters | ||
# | ||
# [*hasrestart*] | ||
# Boolean. Value of hasrestart attribute for this service. | ||
# Default: true | ||
# | ||
class sensu::api ( | ||
Boolean $hasrestart = $::sensu::hasrestart, | ||
) { | ||
|
||
if $::sensu::manage_services { | ||
|
||
case $::sensu::api { | ||
true: { | ||
$service_ensure = 'running' | ||
$service_enable = true | ||
} | ||
default: { | ||
$service_ensure = 'stopped' | ||
$service_enable = false | ||
} | ||
} | ||
|
||
if $::osfamily != 'windows' { | ||
service { 'sensu-api': | ||
ensure => $service_ensure, | ||
enable => $service_enable, | ||
hasrestart => $hasrestart, | ||
subscribe => [ | ||
Class['sensu::package'], | ||
Sensu_api_config[$::fqdn], | ||
Class['sensu::redis::config'], | ||
Class['sensu::rabbitmq::config'], | ||
], | ||
} | ||
} | ||
} | ||
|
||
if $::sensu::_purge_config and !$::sensu::server and !$::sensu::api and !$::sensu::enterprise { | ||
$file_ensure = 'absent' | ||
} else { | ||
$file_ensure = 'present' | ||
} | ||
|
||
file { "${sensu::etc_dir}/conf.d/api.json": | ||
ensure => $file_ensure, | ||
owner => $::sensu::user, | ||
group => $::sensu::group, | ||
mode => $::sensu::file_mode, | ||
} | ||
|
||
sensu_api_config { $::fqdn: | ||
ensure => $file_ensure, | ||
base_path => "${sensu::etc_dir}/conf.d", | ||
bind => $::sensu::api_bind, | ||
host => $::sensu::api_host, | ||
port => $::sensu::api_port, | ||
user => $::sensu::api_user, | ||
password => $::sensu::api_password, | ||
ssl_port => $::sensu::api_ssl_port, | ||
ssl_keystore_file => $::sensu::api_ssl_keystore_file, | ||
ssl_keystore_password => $::sensu::api_ssl_keystore_password, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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.