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

后端 未结 6 1328
醉话见心
醉话见心 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:54

    The following worked for me.

    puppet apply -e ' $y = "Hello" $z = "world" $x = "$y $z" notify { "$x": } '
    notice: Hello world
    notice: /Stage[main]//Notify[Hello world]/message: defined 'message' as 'Hello world'
    notice: Finished catalog run in 0.04 seconds
    

    The following works as well:

    $abc = "def"
    
    file { "/tmp/$abc":
    

提交回复
热议问题