I am traveling at the moment, and I am on GMT+8, so I may reply to
this and other threads with quite a bit of latency...
On Wed, Apr 25, 2012 at 10:22 AM, Daniel Cukier danicuki@gmail.com wrote:
Bryan, I've looked to this refactor, but actually I did not find a good
documentation of how to use it.
Interesting. The documentation is one of the areas I am looking for feedback on.
If you can spare a few minutes, can you elaborate on what you find
unclear in the documentation? Here or private email.
I guess a "how to convert from the old version" tutorial, as you
suggest, would be helpful.
From what I've understood, I need to create a cookbook for my_app and add
the application code block to the default.rb of my cookbook. Is it correct?
That's correct.
If it is so, then it is worse than before, when all I needed to do was
create a data_bag, put some configuration there and create a my_app role
with the application default recipe in its run_list.
To be clear: I don't think removal of the data bag was a goal of the
project, it's more of a side casualty.
Data bags are not very expressive; while it was pretty easy to get
started, people with more advanced use cases kept bumping into
limitations. For example, some attributes were per-environment, some
weren't.
Since the new DSL is more complete and powerful than the old recipe,
it would be quite hard to create a purely data bag-driven mode that is
useful and generic for everybody.
On the other hand, it's pretty easy to roll your own, as Joshua has
demonstrated: chef - [chef] Re: Re: Application cookbook refactoring
Nobody knows what you need better than you, so if you'd rather use a
data bag I suggest you look into that approach.
Another thing is: with this new refactor, do I still need to add the
application recipe to the node run_list?
If your cookbook correctly depends on application and
application_rails (if it's a Rails app), you don't need to explicitly
include the application cookbook.
Moreover, the application::default recipe (and the stack-specific
ones) will be deprecated. Once you are done converting all your apps
to the "new style", you should remove that recipe from the run_list.
We will be keeping backward compatibility, with a deprecation warning,
for about 3 months.