我試圖使用dsc_authenticationinfo => {"Anonymous"=>false, "Basic"=>false, "Digest"=>false, "Windows"=>true},
得到could not evaluate
錯誤下面。此屬性位於dsc_xwebsite {}內部。木偶DSC模塊:無法評估:從類型'INSTANCE []'轉換屬性'認證信息'值以鍵入'INSTANCE'失敗
dsc_xwebsite{$app_dns_name:
dsc_ensure => 'Present',
dsc_name => $app_dns_name,
dsc_state => 'Started',
dsc_physicalpath => $app_webroot_path,
dsc_applicationpool => $app_pool_name,
dsc_bindinginfo => [{
protocol => 'HTTP',
port => 80,
hostname => $app_dns_name,
}],
dsc_authenticationinfo => {"Anonymous"=>true, "Basic"=>true, "Digest"=>true, "Windows"=>true},
}
我在Windows 2012 R2主機上收到以下錯誤。
Error: /Stage[main]/Profiles::Iis_tools/Dsc_xwebsite[tools-dev.domain.com]: Could not evaluate: Convert property 'authenticationinfo' value from type 'INSTANCE[]' to type 'INSTANCE' failed
At line:31, char:2
Buffer:
ls-dev.domain.com";
};^
insta
好的,我在這個潛在的方向上走錯了方向。你的'$ app_dns_name'作爲字符串傳遞嗎?它應該像'$ app_dns_name ='ls-dev.domain.com''而不是'$ app_dns_name = ls-dev.domain.com'。順便說一句,根據dsc_xwebsite類型的源代碼,你的'dsc_bindinginfo'可能是一個散列而不是散列數組。 –
不,它不是ls-dev.domain.com。它應該是tools-dev.domain.com - 但由於某種原因,錯誤信息也會「切斷」。 Puppet通過hiera查找將$ app_dns_name作爲字符串帶入。我相當肯定查找是正確完成的,因爲其他事情正在正確使用該變量。 – FuriousD