Ask Your Question

difference between quotes around a string

asked 2013-12-19 14:38:34 -0600

Thynan gravatar image

updated 2013-12-19 16:36:29 -0600


This may be a very simple question, but i don't completely get the way puppet handles " and ' differently. For example, if i write

notify{"The content of the variable is:  ${some_variable}": }

in my manifest, i get the actual content of $some_variable on my console during a puppet run. However if i write

notify{ 'The content of the variable is:  ${some_variable}': } #(notice the different quote)

I only get the actual text "The content of the variable is: ${some_variable}" on my console.

Why is that, and how does puppet treat " differently from ' ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-12-19 14:55:32 -0600

brenix gravatar image

This is correct, the main difference is that having double quotes allows you to interpolate ${variables} .

More information on how puppet treats this is covered in the data types documentation:

Hopefully that helps

edit flag offensive delete link more


I've not seen this in the docs, but I have been told by Puppet Labs PSEs that string interpolation can cost a small amount of resources, so single quotes ...(more)

jarrettone gravatar imagejarrettone ( 2013-12-20 11:58:18 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-12-19 14:38:34 -0600

Seen: 3,478 times

Last updated: Dec 19 '13