tobami / littlechef

Cook with Chef without a Chef Server
Apache License 2.0
472 stars 70 forks source link

Specifying a deploy_chef version in a config file #105

Open axsuul opened 12 years ago

axsuul commented 12 years ago

Is there any way or plans to support locking in the Chef version that is deployed with fix ... deploy_chef via a config file that can be checked into source control? Reason I ask is due to the recent release of Chef 10.14 which broke the users lwrp and interrupted my normally perfect provisioning :)

tobami commented 12 years ago

The exact same problem happened to us. The problem is that the ability to pin the Chef version depends greatly on what distribution you use and on what deployment method you use (gem vs packages).

For example, how would you ensure that in your particular case?

axsuul commented 12 years ago

That's a good point. But can we assume that the server is barebone? My case mainly applies to provisioning new servers. Servers that have already been provisioned will have a version of Chef that should only be upgraded manually (or with chef itself).

I would make the default the gem deployment.

tobami commented 12 years ago

Why does it have to do with a server being barebone? Do you mean that you want to use deploy_chef to install Chef for the first time on a server?

The problem I meant is that previously, for example for the debian package installation, you had a 0.9.x and a 0.10.x repo. You would not automatically get new 0.X feature releases, only the latest bug fix for that bigger Chef version. From the wiki:

Ubuntu for Chef 0.10.x echo "deb http://apt.opscode.com/ lsb_release -cs-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list

Now, with the new versioning, with "0.10" we got the new "0.10.12" and also the newer "0.10.14" when installing Chef on a new server, which is unfortunate. For other distros or for gem installations it is different, but we need to see how to fix each case.

Are you thinking about contributing a patch? If you really want this what you can do at least is to post here exactly how to pin the Chef version for gem installs.

axsuul commented 12 years ago

Yep, I only use deploy_chef to install Chef for the first time on a brand spankin' new server. I was under the impression that it should only be used for this but it looks like you guys use this during every provisioning sequence?

So with respect only to my use case, we wouldn't need to pin the Chef version but just simply install the version blindly

gem install chef --version 10.10.0

But to pin the version, wouldn't it be

chef-client --version

Forgive any ignorance that I may have exhibited

tobami commented 12 years ago

deploy_chef is usually used just once.

chef-client --version just shows the currently installed version, it has nothing to do with pinning.

As for the gem installation, yes, you can just explicitly specify the version you want to install. That should be easy to implement.