【发布时间】:2013-04-02 17:25:09
【问题描述】:
我正在尝试为 chef graphite repo 编写包装食谱
在配方 carbon.rb 中,出现以下几行:
template "#{node['graphite']['base_dir']}/conf/storage-schemas.conf" do
owner node['apache']['user']
group node['apache']['group']
end
templates/default/storage-schemas.conf 中有一个我不喜欢的 storage-schemas.conf 文件。我可以内联编辑文件并实现我想要的,但如果我希望能够在不发生合并冲突的情况下使我的 repo 保持最新,这似乎不是一个好的厨师实践。所以我想知道我是否可以用包装食谱来解决这个问题。
我的第一个想法是这样的
include_recipe "graphite"
template "#{node['graphite']['base_dir']}/conf/storage-schemas.conf" do
owner node['apache']['user']
group node['apache']['group']
end
我会在基本配方完成后重新运行命令并将我想要的文件放在 wrappercookbook/templates/storage-schemas.conf.erb 中。这是一种常见的做法吗?感觉不是很干,但我想不出更干净的方法。
【问题讨论】:
标签: chef-infra