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

Add loglevel introduced in 0.14.1 #67

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
$refresh = $uchiwa::params::refresh,
$sensu_api_endpoints = $uchiwa::params::sensu_api_endpoints,
$users = $uchiwa::params::users,
$auth = $uchiwa::params::auth
$auth = $uchiwa::params::auth,
$log_level = $uchiwa::params::log_level
) inherits uchiwa::params {

# validate parameters here
Expand All @@ -175,6 +176,7 @@
validate_array($sensu_api_endpoints)
validate_array($users)
validate_hash($auth)
validate_re($loglevel, 'trace|debug|info|warn|fatal')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log_level.


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 @@ -27,6 +27,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 @@ -178,4 +178,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 %>
Expand Down