[chef] RE: Re: Can chef parse the attribute list and handle it while creating templates


Chronological Thread 
  • From: Tarun Behari Agrawal < >
  • To: " " < >
  • Subject: [chef] RE: Re: Can chef parse the attribute list and handle it while creating templates
  • Date: Thu, 16 May 2013 23:02:48 +0530
  • Accept-language: en-US
  • Acceptlanguage: en-US

Thanks guyz..I will try the solutions provided & update on the thread!!

 

Tarun

 

From: Ranjib Dey [mailto:
Sent: 14 May 2013 21:54
To:
Subject: [chef] Re: Can chef parse the attribute list and handle it while creating templates

 

definitely you can do that. can you share the recipe where you are passing the variables in the template / defining the templates. 

 

On Tue, May 14, 2013 at 9:19 AM, < " target="_blank"> > wrote:

Hi All,


I have an attribute which I must pass as list and update it in the template
file But it seems the attributes are taken as literal string during chef-run.
Is there a way to pass a list and handle it in templates  ?



default['zabbix']['agent']['servers_active'] = "hostname"


default['zabbix']['agent']['servers_active'] = "[ "hostname1", "hostname2" ]"

Template where this list need to
ServerActive=<%= node.zabbix.agent.server_active %>
Desired Output
ServerActive=hostname1,hostname2

thanks for your response in advance!
Tarun

 




Archive powered by MHonArc 2.6.16.

§