We use collins [1] as an asset database. It keeps tracks of racks,
switches, servers etc., the state of those things (new, unallocated,
broken), and basically does a lot of cool api & callback driven stuff to
get us from servers on a pallet to running chef-client.
Collins keeps tracks of an arbitrary set of tags about each asset in
addition to inferred hardware and network information. We would like to
be able to expose those tags to chef as attributes. As a trivial
example: if collins says a server is in "maintenance mode" we would like
to have chef edit /etc/motd to say something to that effect.
We have explored two options so far with some help from folks in #chef:
* Just call out to the collins api using the collins-client ruby
library inside select cookbooks
* Write an ohai plugin that dumps everything from collins into ohai.
The first one seemed easy to write but doesn't feel awesome. (Call this
function to get a value instead of values magically appearing.) The
ohai plugin route would (I think) get the magic "attributes just show
up" workflow. But it didn't seem right to duplicate all the data from
one system-of-record into another.
Is there a third option? Are there other examples of injecting HWDB data
into chef?
[1] http://tumblr.github.io/collins/index.html
Archive powered by MHonArc 2.6.16.