我试图使用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