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

Issue #68 - Added SSL Support #69

Merged
merged 2 commits into from
Feb 9, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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,
$ssl = $uchiwa::params::ssl,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a docstring to explain how to use this? Bonus points for a readme update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit: 108c3b3

) inherits uchiwa::params {

# validate parameters here
Expand All @@ -175,6 +176,7 @@
validate_array($sensu_api_endpoints)
validate_array($users)
validate_hash($auth)
validate_hash($ssl)

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 @@ -48,4 +48,5 @@
$refresh = '5'
$users = []
$auth = {}
$ssl = {}
}
8 changes: 7 additions & 1 deletion templates/etc/sensu/uchiwa.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"port": <%= @port %>,
"user": "<%= @user %>",
"pass": "<%= @pass %>",
"refresh": <%= @refresh %><%= ',' if @users.size > 0 or @auth.size == 2 %>
"refresh": <%= @refresh %><%= ',' if @users.size > 0 or @auth.size == 2 or @ssl.size == 2%>
<%- if @users.size > 0 -%>
"users": [
<%- @users.each_with_index do |user, i| -%>
Expand All @@ -47,6 +47,12 @@
"auth": {
"publickey": "<%= @auth['publickey'] %>",
"privatekey": "<%= @auth['privatekey'] %>"
}<%= ',' if @ssl.size == 2 %>
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be easier to just slide this into the if block below no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think thats possible. The ',' should come after the '}' according to JSON standards.
I just copied the same style from the auth section.

<%- end -%>
<%- if @ssl.size == 2 -%>
"ssl": {
"certfile": "<%= @ssl['certfile'] %>",
"keyfile": "<%= @ssl['keyfile'] %>"
}
<%- end -%>
}
Expand Down