我正在使用版本3.8的puppet,我需要将ip地址转换为字符串。我尝试了String函数,但是我收到了一个错误。
这是我正在使用的代码:
class resolver::params {
$ip = String($::ipaddress)
$octs = split($ip, '.')
file{ '/tmp/teste.txt':
content => $octs[0]
}
}
这是输出:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '('; expected ')' at /etc/puppet/modules/resolver/manifests/params.pp:2 on node example.intranet.example.br
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run