Skip to content
This repository has been archived by the owner on Nov 17, 2017. It is now read-only.

Commit

Permalink
include_attribute "CB::File" doesn't allow for overriding the attribute
Browse files Browse the repository at this point in the history
in the environment or role file. Therefore moving the dependent
attributes into the default gdash recipe

Submitted By: viralshah
  • Loading branch information
realityforge committed Oct 14, 2012
1 parent 10905b9 commit 08ef6e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
18 changes: 4 additions & 14 deletions attributes/gdash.rb
@@ -1,28 +1,18 @@
default.gdash.tarfile = "/usr/src/gdash.tgz"
default.gdash.base = "/srv/gdash"
default.gdash.url = "https://github.com/ripienaar/gdash/tarball/master"

####
# WARN: pull in attributes from ANOTHER COOKBOOK
# TODO: put this in a databag ?
####
include_attribute "graphite::whisper"
include_attribute "graphite::web"
default.gdash.graphite_url = "http://#{node['graphite']['web']['host']}:#{node['graphite']['web']['port']}"
####

default.gdash.graphite_url = nil
default.gdash.templatedir = "/srv/gdash/graph_templates"
include_attribute "apache2::default"
default.gdash.owner = node['apache']['user']
default.gdash.group = node['apache']['group']
default.gdash.owner = nil
default.gdash.group = nil
default.gdash.basic_auth = false
default.gdash.username = "gdash"
default.gdash.password = "gdash"
default.gdash.title = "Dashboard"
default.gdash.prefix = nil
default.gdash.refresh_rate = 60
default.gdash.columns = 2
default.gdash.graphite_whisperdb = node['graphite']['whisper']['data_dir']
default.gdash.graphite_whisperdb = nil
default.gdash.port = 9292
default.gdash.interface = node[:ipaddress]
default.gdash.categories = []
Expand Down
7 changes: 7 additions & 0 deletions recipes/default.rb
Expand Up @@ -25,6 +25,13 @@

gem_package "bundler"

# We set these attributes here rather than in attributes files as it gives roles and environments the chance
# to override the attributes
node.override.gdash.graphite_url = "http://#{node['graphite']['web']['host']}:#{node['graphite']['web']['port']}" unless node.gdash.graphite_url
node.override.gdash.graphite_whisperdb = node['graphite']['whisper']['data_dir'] unless node.gdash.graphite_whisperdb
node.override.gdash.owner = node['apache']['user'] unless node.gdash.owner
node.override.gdash.group = node['apache']['group'] unless node.gdash.group

gdash_owner = node.gdash.owner
gdash_group = node.gdash.group

Expand Down

0 comments on commit 08ef6e6

Please sign in to comment.