我试图弄清楚如何在使用 Puppet 配置的 Ruby 模板 erb 文件中使用 Facter 事实。
示例 Ruby 模板变量
zk.l.conn=
Puppet 的预期配置文件输出
zk.l.conn=ip-xx-31-xx-xxx.ec2.internal:2181,ip-xxx-31-xx- xxx.ec2.internal:2181,ip-172-xxx-xxx-xx.ec2.internal:2181
事实数据:
"zk-internal": [
{
"host": "ip-xx-31-xx-xxx.ec2.internal",
"port": 2181,
"priority": 2,
"weight": 10
},
{
"host": "ip-xxx-31-xx-xxx.ec2.internal",
"port": 2181,
"priority": 3,
"weight": 10
},
{
"host": "ip-172-xxx-xxx-xx.ec2.internal",
"port": 2181,
"priority": 1,
"weight": 10
}
],