在此现有块之后
prefix 2a03:2267:4e6f:7264:0000:0000:0000:0000/64
{
};
我想添加一个新块,如果它还不存在:
prefix fdda:fee6:0187:0000:0000:0000:0000:0000/64
{
};
在/etc/radvd.conf
(不在文件的末尾)
然后/etc/init.d/radvd restart
我如何用木偶来管理这个?
答案 0 :(得分:2)
安装
puppet module install puppetlabs-stdlib
然后创建一个脚本addblock.pp:
file_line { "ensure $line in /etc/radvd.conf":
path => '/etc/radvd.conf',
line => "prefix fdda:fee6:0187:0000:0000:0000:0000:0000/64\n{\n};",
}
exec { "restart":
command => '/etc/init.d/radvd restart',
provider => shell,
require => File_line["ensure $line in /etc/radvd.conf"],
}