[chef] Re: env variables for linux - best practice


Chronological Thread 
  • From: "Julian C. Dunn" < >
  • To:
  • Subject: [chef] Re: env variables for linux - best practice
  • Date: Thu, 29 Aug 2013 01:32:32 -0400

Like most things with UNIX/Linux, that depends. UNIX doesn't have an equivalent to "global environment variables".

That said, each shell has its own way of handling globals. tcsh and bash, for example, are often set up to load things from /etc/profile.d, so if you drop files in there, they should be loaded (.sh suffix for bash, .csh suffix for tcsh). A lot of the mechanics depend on your operating system distro though. I run CentOS/RHEL/Fedora and this is what it does.

- Julian

On Wed, Aug 28, 2013 at 10:08 PM, David Montgomery < " target="_blank"> > wrote:

Per the below take from http://docs.opscode.com/chef/resources.html#env


On UNIX-based systems, the best way to manipulate environment keys is with the ENV variable in Ruby; however, this approach does not have the same permanent effect as using the env resource.

What is the best way to use chef resource to add environment variables in Ubuntu?

E.g. if I want to set export AWS_ACCESS_KEY_ID=foobar..what is the most chefonic method do do this?

This there a clear example on how to this?

Thanks



--
[ Julian C. Dunn < " target="_blank"> >          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ]
[ gopher://sdf.org/1/users/keymaker/           * compliant!    ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]



Archive powered by MHonArc 2.6.16.

§