怎样将attribute文件读成hash
Chef中的attribute file都是XXX.rb格式,有什么方法可以把这种XXX.rb格式的文件读成hash
如:
$test['apache']['httpd.conf'] = {
'ServerTokens' => "ProductOnly",
'deflate' => {
'DeflateCompressionLevel' => '1'
},
'KeepAlive' => "On",
'KeepAliveTimeout' => "5",
'ListenBackLog' => "511"
}
其中$test['apache']['httpd.conf']是key,
而{
'ServerTokens' => "ProductOnly",
'deflate' => {
'DeflateCompressionLevel' => '1'
},
'KeepAlive' => "On",
'KeepAliveTimeout' => "5",
'ListenBackLog' => "511"
}是value,依次递归这样读取。
或者把value付给一个变量
请问有实现的方法吗?