我正在使用 Puppet 2.7,我需要将数组转换为逗号分隔列表。
$hosts_fqdn= ['host1','host2','host3']
我需要将其转换为所需的结果:'host1,host2,host3'
我猜 Puppet 3.2 提供了 lambda 表达式 -reduce
。但不幸的是,这在 2.7 中是不可能的。
功能join
from 木偶实验室/stdlib https://forge.puppet.com/puppetlabs/stdlib:
join($hosts_fqdn,',')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)