How do you concatenate strings in a Puppet .pp file?

后端 未结 6 1130
醉话见心
醉话见心 2021-02-03 17:27

Here is my naive approach:

# puppet/init.pp
$x = \'hello \' + 
     \'goodbye\'

This does not work. How does one concatenate strings i

6条回答
  •  无人共我
    2021-02-03 17:53

    As stated in docs, you can just use ${varname} interpolation. And that works with function calls as well:

    $mesosZK = "zk://${join($zookeeperservers,':2181,')}:2181/mesos"
    $x = "${dirname($file)}/anotherfile"
    

    Could not use {} with function arguments though: got Syntax error at '}'.

提交回复
热议问题