Ask Your Question
1

What's the difference between Parameter and Variable in Puppet?

asked 2017-07-03 22:26:24 -0500

Sam online gravatar image

Hello All,

Can someone please help me understand what's the difference between Parameter and Variable in Puppet?

From Puppet Docs: Variables store values so they can be accessed later. Also they are constants, meaning we can't define same variable with another variable in the same the same scope. I get that. Ex: $content = "some content\n"

I get that above part. Then, what is the parameter? Isn't the same thing. This part is little confusing. If someone can please help me with an example, that would be very helpful. Thank you very much.

Sam

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-07-05 14:53:01 -0500

DevOpsProDude gravatar image

A parameter is a variable defined at the top of a class within () that can be overridden with hiera or within a class call and used by any other class.

A variable is defined within the class, cannot be overridden by hiera (unless the variable is using a hiera lookup), but can be used by any other class.

The big difference there is whether the variable can be overridden or not.

edit flag offensive delete link more

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

Stats

Asked: 2017-07-03 22:26:24 -0500

Seen: 27 times

Last updated: Jul 05