2
我試圖使用哈希在木偶的第一次,所以我nodes.pp我將使用:傳遞一個哈希在木偶/定義的類型ERB
node test1.example.com {
netset::int::vconf {"servers" :
label1 => { 'comment' => 'VIP Test1', 'ipaddress' => '192.168.1.10', 'netmask' => '255.255.255.0', 'int_label' => 'TEST1' },
label2 => { 'comment' => 'VIP Test2', 'ipaddress' => '192.168.1.11', 'netmask' => '255.255.255.0', 'int_label' => 'TEST2' },
}
}
在我寫我創建一個定義類型的文件/etc/puppet/modules/netset/int/vconf.pp:
define netset::int::vconf ($comment,$ipaddress){...do somethings...}
我questionis我怎麼通過散列的每個鍵的定義類型?不知何故,我想象着我將不得不在某處創建一個循環,任何幫助都會有很大的幫助。
謝謝丹