Search code examples
string-concatenationpuppet

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


Here is my naive approach:

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

This does not work. How does one concatenate strings in Puppet?


Solution

  • Keyword variable interpolation:

    $value = "${one}${two}"
    

    Source: http://docs.puppetlabs.com/puppet/4.3/reference/lang_variables.html#interpolation

    Note that although it might work without the curly braces, you should always use them.