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我怎么通过散列的每个键的定义类型?不知何故,我想象着我将不得不在某处创建一个循环,任何帮助都会有很大的帮助。
谢谢丹