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 #2 from bodgit/template
Browse files Browse the repository at this point in the history
Fix template so it generates valid JSON
  • Loading branch information
pauloconnor committed Aug 7, 2014
2 parents 3108abb + 5131f59 commit 55d47bf
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions templates/etc/sensu/uchiwa.json.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
module.exports = {
sensu: [
<%- scope.lookupvar("uchiwa::apis").each do | name, api | %>
{
"sensu": [
<% scope.lookupvar('uchiwa::apis').each_with_index do |(name,api),index| -%>
{
name: '<%= name %>',
host: '<%= api['host'] %>',
ssl: <%= api['ssl'] %>,
port: <%= api['port'] %>,
user: '<%= api['user'] %>',
pass: '<%= api['pass'] %>',
path: '<%= api['path'] %>',
timeout: <%= api['timeout'] %>
},
<%- end %>
"name": "<%= name %>",
"host": "<%= api['host'] %>",
"port": <%= api['port'] || 4567 %>,
"ssl": <%= api['ssl'] || false %>,
"user": "<%= api['user'] %>",
"pass": "<%= api['pass'] %>",
"path": "<%= api['path'] %>",
"timeout": <%= api['timeout'] || 5000 %>
}<%= ',' if index < scope.lookupvar('uchiwa::apis').length - 1 %>
<% end -%>
],
uchiwa: {
host: '<%= scope.lookupvar("uchiwa::host") %>',
port: <%= scope.lookupvar('uchiwa::port') %>,
user: '<%= scope.lookupvar("uchiwa::user") %>',
pass: '<%= scope.lookupvar("uchiwa::pass") %>',
stats: <%= scope.lookupvar('uchiwa::stats') %>,
refresh: <%= scope.lookupvar('uchiwa::refresh') %>
"uchiwa": {
"host": "<%= scope.lookupvar('uchiwa::host') %>",
"port": <%= scope.lookupvar('uchiwa::port') %>,
"user": "<%= scope.lookupvar('uchiwa::user') %>",
"pass": "<%= scope.lookupvar('uchiwa::pass') %>",
"stats": <%= scope.lookupvar('uchiwa::stats') %>,
"refresh": <%= scope.lookupvar('uchiwa::refresh') %>
}
}
}

0 comments on commit 55d47bf

Please sign in to comment.