This cookbook represents an example of how to upload a cookbook to multiple Chef
Servers. We accomplish this by leveraging the delivery_chef_cookbook
resource
made available from delivery-sugar
.
For information on how to use delivery_chef_cookbook
, please check out the
documentation here.
This cookbook lays down the necessary knife environments on a per-project basis by storing
the client keys in chef-vault and calling them from there. You can also lay the knife
environments down per project but you can also lay them down using other means such as
a global cookbook or manual. All that is required is that you give the fully-qualified path
to a working (working = can work outside delivery) knife.rb to the DeliverySugar::ChefServer
instance.
chef_server = DeliverySugar::ChefServer.new('/fully/qualified/path/to/knife.rb')
The only requirements to make this work is that your build cookbook depend on
delivery-sugar
. If you are using delivery-truck
then this will happen automatically
for you. Otherwise take a look at the Berksfile
and metadata.rb
for an example
of how to depend explicitly on delivery-sugar
.