Puppet DSL : String concatenation.

0 votes
is there a string concatenation operator in the Puppet DSL? It appears that there is currently no such thing. But how do i achieve the objective of string concatenation in puppet? How do I create a string composed of multiple string values?
Aug 8 in Puppet by Henry
24 views

1 answer to this question.

0 votes

Method 1: One way is 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.

Method 2: Another option is using Puppets sprintf() function, which functions identically to the ruby function behind it. 

An example:

$x = sprintf('hello user %s', 'CoolUser')

It is verified to work perfectly with puppet. This approach can also help you concatenate the output of functions.

answered Aug 8 by Sirajul
• 31,180 points

Related Questions In Puppet

0 votes
1 answer

Puppet: String Interpolation in puppet

Try this for Keyword variable interpolation: $value = ...READ MORE

answered Aug 29 in Puppet by Sirajul
• 31,180 points
20 views
+5 votes
2 answers

How To Deploy Windows Server Using Puppet?

Deploying windows server through Puppet is similar ...READ MORE

answered Mar 26, 2018 in Puppet by shubham
• 6,890 points
319 views
+1 vote
1 answer

Steps to trigger puppet agent from jenkins

Heyy @Hannah,  First, you need to create Jenkins slave, ...READ MORE

answered Dec 16, 2018 in Puppet by Kiyara
689 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
181 views
0 votes
1 answer
0 votes
1 answer

Puppet+kubernetes: How do I describe a Kubernetes Pod in Puppet DSL?

The Puppet Kubernetes module currently assumes you ...READ MORE

answered Aug 21 in Puppet by Sirajul
• 31,180 points
12 views
0 votes
1 answer

Puppet and Jenkins: How can I manage Jenkins job using Puppet DSL?

Managing Jenkins jobs: Build jobs can be managed ...READ MORE

answered Aug 28 in Puppet by Sirajul
• 31,180 points
14 views