对于我的以下食谱:
template '/etc/filebeat/filebeat.yml' do
source 'filebeat.yml.erb'
owner 'root'
group 'root'
mode '0600'
variables(
stack_name: stack_name,
instance_ip: instance_ip
)
end
我收到以下错误:
Chef::Mixin::Template::TemplateError
------------------------------------
(erubis):74: syntax error, unexpected '}', expecting keyword_end
Resource Declaration:
---------------------
# In /var/chef/runs/8f9aa33c-6b69-419d-8a02-5668701a228a/local-mode-cache/cache/cookbooks/filebeat/recipes/filebeat.rb
28: template '/etc/filebeat/filebeat.yml' do
29: source 'filebeat.yml.erb'
30: owner 'root'
31: group 'root'
32: mode '0600'
33: variables(
34: stack_name: stack_name,
35: instance_ip: instance_ip
36: )
37: end
38:
Compiled Resource:
------------------
# Declared in /var/chef/runs/44a77122-2816-4f89-97c4-9cbff0bbdfcb/local-mode-cache/cache/cookbooks/-filebeat/recipes/filebeat.rb:28:in `from_file'
template("/etc/filebeat/filebeat.yml") do
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
source "filebeat.yml.erb"
variables {:stack_name=>"fsdfsd", :instance_ip=>"172.31.63.242"}
declared_type :template
cookbook_name "filebeat"
recipe_name "filebeat"
owner "root"
group "root"
mode "0600"
path "/etc/filebeat/filebeat.yml"
end
我究竟做错了什么?
我认为错误在您的模板文件中,例如 filebeat.yml.erb
我假设的原因是基于(erubis):74: syntax error, unexpected '}', expecting keyword_end
- erubis 是厨师使用的快速 eRuby 兼容模板引擎(“erb”)。所以错误源于解析/渲染模板文件,而不是厨师特定的问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句