mbdvg
mbdvg

Reputation: 2724

how to read environment variable in chef recipe

I am writing deployment script, it needs to perform based on the system variable. Is there any way to read specific environmental variable through chef recipe ?

Upvotes: 3

Views: 6080

Answers (1)

Javier Cortejoso
Javier Cortejoso

Reputation: 9176

You can use Ruby native way to manage environmental variables (ruby-doc link). Thus you can reference a environmental variable from your recipe directly using ENV['MY_VARIABLE'].

Upvotes: 4

Related Questions