Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request hectcastro#5 from lewg/graph-templates
Browse files Browse the repository at this point in the history
Graph templates configuration support.
  • Loading branch information
hectcastro committed Aug 1, 2012
2 parents c6eaa46 + c9693e0 commit 863bbab
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -33,6 +33,19 @@ and [Infochimps](https://github.com/infochimps-labs/ironfan-pantry/blob/master/c
* `node["graphite"]["dashboard"]["timezone"]` - Default dashboard timezone.
* `node["graphite"]["dashboard"]["memcache_hosts"]` - Array of IP and port pairs
for memcached.
* `node["graphite"]["templates"]` - Additional template defintions

### Default Template Definition

* `default["graphite"]["templates"]["default"]["background"]` = "black"
* `default["graphite"]["templates"]["default"]["foreground"]` = "white"
* `default["graphite"]["templates"]["default"]["majorLine"]` = "white"
* `default["graphite"]["templates"]["default"]["minorLine"]` = "grey"
* `default["graphite"]["templates"]["default"]["lineColors"]` = "blue,green,red,purple,brown,yellow,aqua,grey,magenta,pink,gold,rose"
* `default["graphite"]["templates"]["default"]["fontName"]` = "Sans"
* `default["graphite"]["templates"]["default"]["fontSize"]` = "10"
* `default["graphite"]["templates"]["default"]["fontBold"]` = "False"
* `default["graphite"]["templates"]["default"]["fontItalic"]` = "False"

## Recipes

Expand Down
11 changes: 11 additions & 0 deletions attributes/default.rb
Expand Up @@ -4,3 +4,14 @@
default["graphite"]["carbon"]["cache_query_interface"] = "127.0.0.1"
default["graphite"]["dashboard"]["timezone"] = "America/New_York"
default["graphite"]["dashboard"]["memcache_hosts"] = [ "127.0.0.1:11211" ]

# The default values template
default["graphite"]["templates"]["default"]["background"] = "black"
default["graphite"]["templates"]["default"]["foreground"] = "white"
default["graphite"]["templates"]["default"]["majorLine"] = "white"
default["graphite"]["templates"]["default"]["minorLine"] = "grey"
default["graphite"]["templates"]["default"]["lineColors"] = "blue,green,red,purple,brown,yellow,aqua,grey,magenta,pink,gold,rose"
default["graphite"]["templates"]["default"]["fontName"] = "Sans"
default["graphite"]["templates"]["default"]["fontSize"] = "10"
default["graphite"]["templates"]["default"]["fontBold"] = "False"
default["graphite"]["templates"]["default"]["fontItalic"] = "False"
10 changes: 10 additions & 0 deletions recipes/dashboard.rb
Expand Up @@ -11,6 +11,14 @@
action :install
end

template "/opt/graphite/conf/graphTemplates.conf" do
mode "0644"
source "graphTemplates.conf.erb"
owner node["apache"]["user"]
group node["apache"]["group"]
notifies :restart, "service[apache2]"
end

template "/opt/graphite/webapp/graphite/local_settings.py" do
mode "0644"
source "local_settings.py.erb"
Expand All @@ -23,6 +31,8 @@
notifies :restart, "service[apache2]"
end



apache_site "000-default" do
enable false
end
Expand Down
14 changes: 14 additions & 0 deletions templates/default/graphTemplates.conf.erb
@@ -0,0 +1,14 @@
<% @node["graphite"]["templates"].each do |template_name, template_values| %>
[<%= template_name %>]
<% if template_values.has_key?("background") %>background = <%= template_values["background"] %><% end %>
<% if template_values.has_key?("foreground") %>foreground = <%= template_values["foreground"] %><% end %>
<% if template_values.has_key?("majorLine") %>majorLine = <%= template_values["majorLine"] %><% end %>
<% if template_values.has_key?("minorLine") %>minorLine = <%= template_values["minorLine"] %><% end %>
<% if template_values.has_key?("lineColors") %>lineColors = <%= template_values["lineColors"] %><% end %>
<% if template_values.has_key?("fontName") %>fontName = <%= template_values["fontName"] %><% end %>
<% if template_values.has_key?("fontSize") %>fontSize = <%= template_values["fontSize"] %><% end %>
<% if template_values.has_key?("fontBold") %>fontBold = <%= template_values["fontBold"] %><% end %>
<% if template_values.has_key?("fontItalic") %>fontItalic = <%= template_values["fontItalic"] %><% end %>
<% end %>

0 comments on commit 863bbab

Please sign in to comment.