By the way, I've been using the ruby manifests and its great cause I can use ruby in the manifests :-) I.e. I can have blocks of ruby before the main manifest attributes to build up hashes and then use them in the spice weasel sections. Both as pure ruby and thru ruby string interpolation. This is especially helpful for passing in json blobs to set chef override attributes instead of or in addition to using roles. So a "preamble" section sets up a bunch of global and specific overrides: # "Global" attributes that should be applied to all nodes cluster_attributes = { :cluster_name => "qa00" } # Hash of each attributed override for each node overrides = { # The pod Node :pod_attributes => { :pod => "default", :haproxy => { :balance_algorithm => "hdr(X-Real-IP)", :defaults_options => [ "httplog", "dontlognull", "forwardfor", "redispatch", "httpchk GET /ui/" ] }, :logstash => { :awesant=> { :inputs => [ {:file =>{ :type => 'secure', :path => '/var/log/secure', } } ] } } }, # The cluster nodes :cluster_attributes => {}, # The engine app nodes :engine_attributes => {} } # Merge the cluster level overrides into the individual overrides overrides.each_pair { |k,v| overrides[k].merge!(cluster_attributes) } Then in the spice weasel section I can say things like #{overrides[:pod_attributes].to_json} to set the Json attributes passed into the chef run: "clusters"=> [ { "qa"=> [ { "ec2 1"=> { "run_list"=>"role[pod] recipe[pod] recipe[logstash::awesant]", "options"=> "-d chef-full -S qa00-east1 -G qa00 -I ami-ac6d9172 -f m1.medium -j \'#{overrides[:pod_attributes].to_json}\' -N qa_plb{{n}}.app.example.com" } }, ... __________________________________ Robert J Berger +1 408-838-8896 Internet Bandwidth Development, LLC On Aug 9, 2013, at 10:13 AM, Matt Ray <
">
> wrote:
|
Archive powered by MHonArc 2.6.16.