3
我有以下節點定義:在廚師的食譜類錯誤
{
"prestashop_sites" : {
"site1": { "username": "dave", "password" :"password123", "URL":"www.madeup.com" },
"site2": { "username": "dave2", "password" :"password12", "URL":"www.madeup2.com" }
},
"run_list": [
"recipe[prestashop]"
]
}
和配方:
node["prestashop_sites"].each do |site|
username site['username']
Chef::Log.debug("Found a server: #{site['username']}")
end
remote_file "/tmp/prestashop152.zip" do
source "http://www.prestashop.com/download/old/prestashop_1.5.2.0.zip"
mode "0644"
checksum "37aee9ef5388376e4377aeb240ab027e"
backup false
not_if "test -f /tmp/prestashop152.zip"
end
execute "unzip -o /tmp/prestashop152.zip -d #{node[:prestashop][:location]}" do
not_if "test -f /var/www/#{node[:prestashop][:user]}/prestashop/index.php"
end
所以我的目標是要安裝的Prestashop的多個實例(之後我完成腳本) 。
但是卻困:
10: node["prestashop_sites"].each do |site|
11>> Chef::Log.debug("Found a server: #{site['username']}")
12: end
Mon, 12 Nov 2012 21:26:14 +0100] DEBUG: Re-raising exception:
TypeError - can't convert String into Integer
任何想法,爲什麼?!
該死的;那個笨蛋。 :) 非常感謝 ! – Disco