[chef] Dynamic template path.


Chronological Thread 
  • From: < >
  • To:
  • Subject: [chef] Dynamic template path.
  • Date: Tue, 22 May 2012 11:09:05 -0700 (PDT)

I need to create a template for network scripts, eg:

template "/etc/sysconfig/network-scripts/ifcfg-xxx" do
.
end

Where "xxx" is specified in either default or override attributes. I have
tried:

template "/etc/sysconfig/network-scripts/ifcfg-xxxi#{node['xxx']}" do
template "/etc/sysconfig/network-scripts/ifcfg-" + node['xxx'] do

path = "/etc/sysconfig/network-scripts/ifcfg-" + node['xxx']
template path do

but all give knife upload errors of the form:
FATAL:
/hepuser/crlb/Git/chef-repo/cookbooks/nimbus/recipes/KVM_VMM_control_node.rb:46:
syntax error, unexpected tIDENTIFIER, expecting ']'

Suggestions please.



Archive powered by MHonArc 2.6.16.

§