On Thu, Dec 9, 2010 at 10:24 AM, Joshua Timberman joshua@opscode.com 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//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 environment0. 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.
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