Chef - 模板中的变量
Chef - variables in template
我是 Chef 的新手,想知道如何将变量从属性传递到模板:
我的食谱名称是:apache
在我的属性文件 (default.rb) 中:
default['apache']['serverpath'] = '/etc/apache2'
在我的模板 (apache.erb) 中,我尝试使用该变量:
<% @serverpath %>
这个这个不行,我哪里做错了?
您需要将 variables serverpath: node['apache']['serverpath']
添加到您的食谱代码中。
我是 Chef 的新手,想知道如何将变量从属性传递到模板:
我的食谱名称是:apache
在我的属性文件 (default.rb) 中:
default['apache']['serverpath'] = '/etc/apache2'
在我的模板 (apache.erb) 中,我尝试使用该变量:
<% @serverpath %>
这个这个不行,我哪里做错了?
您需要将 variables serverpath: node['apache']['serverpath']
添加到您的食谱代码中。