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

Commit

Permalink
Merge pull request #69 from FireDrunk/master
Browse files Browse the repository at this point in the history
Issue #68 - Added SSL Support
  • Loading branch information
solarkennedy committed Feb 9, 2016
2 parents c1f9e42 + 108c3b3 commit a460563
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
23 changes: 23 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@ node 'uchiwa-server.foo.com' {
}
```

## SSL (HTTPS)

This is an example on how to use Uchiwa with HTTPS:

Puppet:
```
class { 'uchiwa':
ssl = {
'certfile' => '/path/to/certfile',
'keyfile' => '/path/to/keyfile',
}
}
```
Simple YAML:
```
uchiwa::ssl: { 'certfile': '/opt/ssl/public.crt', 'keyfile': '/opt/ssl/private.key' }
```

Litle more advanced:
```
uchiwa::ssl: { 'certfile': '/opt/ssl/%{::hostname}.crt', 'keyfile': '/opt/ssl/%{::hostname}.key' }
```

## License

See LICENSE file.
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,
) 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 %>
<%- end -%>
<%- if @ssl.size == 2 -%>
"ssl": {
"certfile": "<%= @ssl['certfile'] %>",
"keyfile": "<%= @ssl['keyfile'] %>"
}
<%- end -%>
}
Expand Down

0 comments on commit a460563

Please sign in to comment.