- From: Clif Smith <
>
- To:
- Subject: [chef] Re: Re: managing custom apache configs chef
- Date: Wed, 15 Aug 2012 09:45:03 -0500
You could also specify the data per environment in a data bag:
"log_level": {
"production": "debug",
"development": "info"
}
cjs
On Aug 15, 2012, at 3:01 AM, Adam Wilbraham
<
>
wrote:
>
Are you using chef's environments functionality or just wanting to
>
rely on a a file on the server?
>
>
I use Chef's environments to dictate which data bag to use in some
>
situations - based on that logic you could call a bash function I
>
guess:
>
>
# pull the data we need from the encrypted data bag
>
secrets_bag = "#{[node.chef_environment]}-secrets"
>
Chef::Log.info("Based on the environment I'm using #{secrets_bag} as
>
the secrets data bag")
>
>
>
There is probably a cleaner way to achieve your end result though -
>
you probably want something a little more programmatic in your
>
httpd.conf.erb template which check's the environment and sets the
>
value based on that, rather than relying on bash / sed.
>
>
Wilb
>
>
On 15 August 2012 04:48, Zippy Zeppoli
>
<
>
>
wrote:
>
> Hi List,
>
> Is it possible to do the following with Chef and an httpd.conf file.
>
> Here is my logic:
>
>
>
> if environment_name (perhaps comes from a file on the system) == PRODUCTION
>
> then sed -i s/LogLevel DEBUG/LogLevel INFO/
>
> fi
>
>
>
> So basically if a server meets some condition, then modify the file that is
>
> being managed by chef.
>
>
>
> Are there any example recipes/cookbooks to this point?
>
>
>
> Thank you,
>
> Z
Archive powered by MHonArc 2.6.16.