Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

loglevel introduced in 0.14.1 - rebased #87

Merged
merged 3 commits into from
Nov 18, 2017
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
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
$auth = $uchiwa::params::auth,
$ssl = $uchiwa::params::ssl,
$usersoptions = $uchiwa::params::usersoptions,
$log_level = $uchiwa::params::log_level
) inherits uchiwa::params {

# validate parameters here
Expand All @@ -180,6 +181,7 @@
validate_hash($auth)
validate_hash($ssl)
validate_hash($usersoptions)
validate_re($log_level, 'trace|debug|info|warn|fatal')

anchor { 'uchiwa::begin': }
-> class { 'uchiwa::install': }
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$manage_services = true
$manage_package = true
$manage_user = true
$log_level = 'info'

$sensu_api_endpoints = [
{
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/uchiwa_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,12 @@
}
end

context 'with debug log level' do
let(:params) {{ :log_level => 'debug' }}
it {
should contain_file('/etc/sensu/uchiwa.json') \
.with_content(/"loglevel": "debug"/)
}
end

end
1 change: 1 addition & 0 deletions templates/etc/sensu/uchiwa.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"uchiwa": {
"host": "<%= @host %>",
"port": <%= @port %>,
"loglevel": "<%= @log_level %>",
"user": "<%= @user %>",
"pass": "<%= @pass %>",
"refresh": <%= @refresh %><%= ',' if @users.size > 0 or @auth.size == 2 or @ssl.size == 2 or @usersoptions.size > 0 %>
Expand Down