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
...