LittleChef 1.0 released

80 views
Skip to first unread message

Miquel Torres

unread,
Sep 22, 2011, 6:16:39 AM9/22/11
to littl...@googlegroups.com
Hi all!

after a couple of weeks of production use at edelight, I am confident
enough to tag master as 1.0.0. Yes, we got there!

The main reason I bumped the version up to a full 1.0, besides already
being pretty well tested, was that we have reached the goal of being
nearly 100% compatible with Opscode's official cookbooks. As always,
all current functionality is detailed in the README, and the full list
of changes is found in CHANGELOG.

Here is a list with the major changes:


The executable name
=================
We have renamed "cook" into "fix" so that we don't collide with an
older Debian package.
It was not easy to find an available name which was equivalent to
"cook", but "fix" not only is a cook synonym, but it also feels right
to type "fix node:mynode" ;-)
This should eventually bring us into Debian.


Syncing
=======
As the kitchen repository kept growing with many cookbooks and nodes,
uploading all files on every run was getting a bit slow. Markus
implemented node syncing using rsync (instead of uploading), which
speeds up things massively from the second run on.


Data Bags
========
The mini-library to read data bags was removed from LittleChef because
Chef 0.10.4 already supports data bags for Chef Solo. Great!


Search support for data bags
=====================
Markus did a tremendous job for this release, the most impressive part
being a data bag search library, which we released as a separate
project: https://github.com/edelight/chef-solo-search

LittleChef now automatically adds that library to the node's
cookbooks, which means that your recipes will be able to use search
inside data bags without a Chef Server!

Which makes the next point possible...


Node Search
==========
Without a doubt the biggest news. For every configuration run,
LittleChef will compute a node data bag on the fly, which will contain
a node item for each node file found in your kitchen's nodes/
directory. The attributes of that node data bag will even be the
*merged* attributes for that node. That means that the run list will
be read, expanded, and based on that the cookbook attributes will be
set, and merged with the node and role (default und override)
attributes following Chef's precedence rules (bear in mind that you
need correct cookbook metadata.json files for cookbook attributes to
be available).

When a recipe uses, for example,
munin_servers = search(:node, "role:#{node['munin']['server_role']}
AND chef_environment:#{node.chef_environment}")

Chef Solo will look for a data bag named "node" and will look there
for items matching the search criteria (in this case it will get the
node with the role "monitoring"). Node search now works for LittleChef
users!


Environments
==========
The official Opscode cookbooks use node.chef_environment all over the
place, which is not an attribute you can normally set in the node or
role attributes. We include now a patch which allows precisely that.
Note that you still won't be able to set the chef_environment value
inside a recipe (nor should you want to!), but if you assign the
chef_environment inside a node definition, it will "belong" to that
environment. So that part of the search will now work as well, without
any changes to the official cookbooks.


Node files
=======
Because we want to be able to use node search and get the attributes
of other nodes, LittleChef will automatically add the attribute
ipaddress to a node file after it is configured (read from ohai
ipaddress), so that when the automatic node data bag is computed the
node items will hold their ipaddress value. The FQDN and hostname for
each node element are taken from the node file name, which should be
its FQDN.


Multi-node execution
===============
"cook node:mynode configure" is now
"fix node:mynode"

If neither recipe:X nor role:Y are used, "fix node:mynode" will assume
you want a full configuration run. Less typing for the most frequent
command.

Execution logic has also been expanded so that a list of nodes can be given:
"fix node:server1,server2,server3" (note without blank spaces between
node names) will *sequentially* configure all three nodes. Now you can
go get a coffee and when you are back the new cluster is up ;-)


That was all. I hope you enjoy this release!

Miquel

Reply all
Reply to author
Forward
0 new messages