0
我有以下厨师食谱,并且我不想在厨师独奏下融合时运行模板资源。在厨房聚合的时候,它似乎并不服从not_if。它仍然尝试连接厨师服务器。请帮忙。厨师模板资源not_if独奏
配方,
template '/etc/hosts' do
not_if Chef::Config[:solo]
source 'hosts.erb'
mode '0644'
owner 'root'
group 'root'
variables({
:nodes => search(:node, 'ipaddress:*')
})
end
模板,
...
<% @nodes.each do |n| -%>
<% if (n['fqdn'] && n['ipaddress']) -%>
<%= n['ipaddress'] %> <%= n['fqdn'] %>
<% end -%>
<% end -%>
...
.kitchen.yml
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: centos-6.7
...