如何在 Puppet 2.7 中将数组转换为逗号分隔的字符串
问题描述:
我使用的是 Puppet 2.7,我需要将数组转换为逗号分隔的列表.
I am using Puppet 2.7 and I need to convert an array to comma separated list.
$hosts_fqdn= ['host1','host2','host3']
我需要将其转换为所需的结果:'host1,host2,host3'
And I need to convert it to desired result: 'host1,host2,host3'
我猜 Puppet 3.2 提供了 lambda 表达式 - reduce
.但不幸的是,这在 2.7 中是不可能的.
I guess that Puppet 3.2 offers lambda expression - reduce
. But unfortunately that is not possible with 2.7.