1
我试图获得为一系列Registry_keys构建的厨师食谱。它们都在主厨属性default.rb中进行托管。我试图调用每个键的定义属性和create_if_missing
。在厨师属性中调用数组中的数组
代码示例如下。
厨师attribute\default.rb
default['randomhost']['registry']['entries'] = [
{
'Key' => 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\RandomApplication',
'Values' => [
{
name: 'RandomValueName',
type: :qword,
data: 1
}, {
name: 'RandomValueName2',
type: :qword,
data: 2
}
]
}
]
厨师Recipe\registryKey.rb
node['randomhost']['registry']['entries'].each do |item|
registry_key item['Key'] do
values item['Values']
recursive true
action :create_if_missing # Default
end
end
当我去建了这一点,称item['Values']
声称
Bad key name in RegistryKey values hash
我不完全知道为什么,这是name:
,type:
和data:
是属性数组中的所有符号。
任何帮助,将不胜感激。 谢谢
是那些实际值您使用的还是你纂呢? – coderanger
我不认为混合两个散列符号是一个好主意。请参阅[documentation](https://docs.chef.io/resource_registry_key.html#syntax),例如 – Tensibai
这些值已被编辑。 –