- From: Hedge Hog <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Changing a cookbook's folder-name - how painful?
- Date: Thu, 9 Dec 2010 10:56:01 +1100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=r1pSq5k8xhO8VSi+Jvqp3x1anFUejqwEEbBOWb+UsvptZxv9aBcgXlTnnvaKouO6FU QKB7jzUbAYlPnE4g7upaUjpYmLlrHNPo03EU7j0r9C0A9Vh/Rj+WJDJdiricrw/jjxnC PLQTPedsYyX6DCKbwzq8MLNADI7+4VVI354e4=
On Thu, Dec 9, 2010 at 10:24 AM, Joshua Timberman
<
>
wrote:
>
-----BEGIN PGP SIGNED MESSAGE-----
>
Hash: SHA1
>
>
Hello!
>
>
On Dec 8, 2010, at 12:27 PM, Hedge Hog wrote:
>
>
> I'm struggling to see if or how environments show up 'on-the-disk' in
>
> the chef-repo.
>
> From the feature file I see the HTTP API uses:
>
> ./environments/<env>/cookbooks
>
>
>
> It seems this does not map to the chef-repo - or at least looking at
>
> what is currently in the environments branch.
>
>
>
Environments will go in the directory "environments" in the chef-repo. For
>
example from my testing sandbox:
>
OK, I'd not pulled the branch correctly - apologies.
In the 'you manage environments with files' use case mentioned on the
wiki, could the following be an alternative to editing a file to add a
cookbook, i.e. only the cookbook_versions line would be absent or over
ridden by the presence of a sub-folder ./development/cookbooks:
$ ls -la ~/chef-repo/environments/*
development.rb
production.rb
staging.rb
development:
total 8
drwxr-sr-x 2 hedge users 22 2010-12-09 10:34 .
drwxrwsr-x 9 hedge users 4096 2010-12-09 10:34 ..
drwxr-xr-x 3 hedge users 20 2010-12-08 16:09 cookbooks
production:
total 8
drwxr-sr-x 2 hedge users 22 2010-12-09 10:34 .
drwxrwsr-x 9 hedge users 4096 2010-12-09 10:34 ..
drwxr-xr-x 3 hedge users 20 2010-12-08 16:09 cookbooks
staging:
total 8
drwxr-sr-x 2 hedge users 22 2010-12-09 10:34 .
drwxrwsr-x 9 hedge users 4096 2010-12-09 10:34 ..
drwxr-xr-x 3 hedge users 20 2010-12-08 16:09 cookbooks
Where
$ ls -la ~/chef-repo/environments/development/*
cookbooks:
total 20
drwxr-xr-x 26 hedge users 4096 2010-12-08 16:10 .
drwxr-xr-x 10 hedge users 4096 2010-12-08 16:09 ..
drwxr-xr-x 8 hedge users 4096 2010-12-08 16:10 apache2
drwxr-xr-x 5 hedge users 118 2010-12-08 16:09 application
drwxr-xr-x 5 hedge users 114 2010-12-08 16:09 apt
etc.
What benefit does this bring?
I, or my script, can update cookbooks without having to edit any
files, by installing them to a folder as follows:
bundle install --without production staging --gemfile
~/chef/app_stacks/rails.gemfile --install-path
~/chef/chef-repo/environments/development/cookbooks
There is some way to go to get bundler to fully live up to its
potential and play its complete part, but it'd be nice to have Chef's
door left open.
Appreciate the consideration.
>
% ls ~/chef-repo/environments
>
development.rb
>
production.rb
>
staging.rb
>
>
Each of those is the Ruby DSL file for the environment[0]. The cookbook
>
versions would be specified in the environment. The directory structure
>
does not change on disk. The association happens on the server side through
>
the API automatically.
>
>
>
[0]: http://wiki.opscode.com/display/chef/Environments
>
- --
>
Opscode, Inc
>
Joshua Timberman, Technical Evangelist
>
IRC, Skype, Twitter, Github: jtimberman
>
>
-----BEGIN PGP SIGNATURE-----
>
Version: GnuPG v1.4.10 (Darwin)
>
>
iEYEARECAAYFAk0AE8cACgkQO97WSdVpzT17CwCfbSF7I/oSKpddeIj9Lcf75GqN
>
TgcAnRGWT10XcVNjWHPE+aOGsiPvIzci
>
=jU/u
>
-----END PGP SIGNATURE-----
>
--
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
Archilochus, Greek poet (c. 680 BC – c. 645 BC)
http://wiki.hedgehogshiatus.com
Archive powered by MHonArc 2.6.16.