[chef] Re: Databags parsing and templates


Chronological Thread 
  • From: Loïc Antoine-Gombeaud < >
  • To:
  • Subject: [chef] Re: Databags parsing and templates
  • Date: Fri, 14 Dec 2012 16:29:02 +0100

Your each loop is weird :

On Fri, Dec 14, 2012 at 3:49 PM, Philippe Bérard < " target="_blank"> > wrote:

data_bag(‘instances’).each do |webapps|

    s = data_bag_item(‘instances’,'webapps')

    server << s['name']

    port << s['port']

end


The variable webapps is never used in the block (you are using the string 'webapps' instead); and the way you are defining s, it will contain the same info every time.
And your each loop in the template looks very funky as well... how is your block supposed to know about port, if you're iterating on server ?

--
Loïc ANTOINE-GOMBEAUD
IT Engineer I
Plinga GmbH | www.plinga.com
Saarbrücker Straße 20/21 | 10405 Berlin | Germany

E-Mail: " target="_blank"> | Skype:loic.plinga
Telefon : +49(0)160-92286573

Geschäftsführer: Johannes Kreibohm, Florian Schmidt-Amelung
Eingetragen beim Amtsgericht Charlottenburg, HRB 119994




Archive powered by MHonArc 2.6.16.

§