Chef Provisioning - How to use 'chef_server' attribute

92 Views Asked by At

I am writing a Chef provisioning recipe to deploy a number of VMs in our vCenter, using vSphere driver for chef provisioning.

As far as I understand machine and batch_machine resources have a chef_server attribute, however there is not much documentation about how this must be used or how it impacts, further than indicating it must be a ruby hash.

Anyone has used this attribute before? Can I use it to use our Chef Server for bootstrapping or provide our cookbooks? Anyone could provide some documentation or manual about how to use this?

1

There are 1 best solutions below

0
On

Not sure if this will help you but I set the chef server url outside the machine/machine_batch resource. Something like this:

with_chef_server 'https://api.chef.io/organizations/my_org',
  :client_name => Chef::Config[:node_name],
  :signing_key_filename => Chef::Config[:client_key]

I found this info on https://github.com/chef/chef-provisioning#pointing-boxes-at-chef-servers The Chef::Config settings come from knife.rb file. All my instances in a chef provision run talk to same chef server so I don't bother setting chef_server on machine resource. I did make the chef server url an attribute so I can change it by loading a different environment file when I provision.