diff --git a/README.md b/README.md index f17604d..1fa0e86 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/attributes/default.rb b/attributes/default.rb index dbe270a..7140410 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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" \ No newline at end of file diff --git a/recipes/dashboard.rb b/recipes/dashboard.rb index 3448601..c0c0dd9 100644 --- a/recipes/dashboard.rb +++ b/recipes/dashboard.rb @@ -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" @@ -23,6 +31,8 @@ notifies :restart, "service[apache2]" end + + apache_site "000-default" do enable false end diff --git a/templates/default/graphTemplates.conf.erb b/templates/default/graphTemplates.conf.erb new file mode 100644 index 0000000..70e21c3 --- /dev/null +++ b/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 %> \ No newline at end of file