[chef] Data-Bag how to use in templates


Chronological Thread 
  • From: WEINHAPL Andreas < >
  • To: " " < >
  • Subject: [chef] Data-Bag how to use in templates
  • Date: Wed, 23 Mar 2011 08:21:12 +0100
  • Accept-language: en-US, fr-FR
  • Acceptlanguage: en-US, fr-FR

HI,

 

Yesterday I tested the Data-Bag! But I’m not able to use the Information from the DataBag in Templates.

My recipe is:

GLOBAL = data_bag_item('GLOBAL', 'NTP') and just use a template-function (create a file from file.erb)

 

In my file.erb:

<%= node[:GLOBAL][:ntp_2_thalesgroup.at] %>

 

But If I start a chef-client I will get this problem:

Chef::Mixin::Template::TemplateError (undefined method `at' for :ntp_2_thalesgroup:Symbol) on line #3:

 

Could anybody help me please?!

 

Regards

Andreas




Archive powered by MHonArc 2.6.16.

§