0

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?

chicks
  • 2,393
  • 3
  • 24
  • 40
Navarro
  • 1,284
  • 2
  • 17
  • 40
  • 1
    I'm on mobile so you're getting the short version of my disclaimer, but just beware we do not recommend new users use chef-provisioning anymore as it is no longer under significant development. See https://coderanger.net/provisioning for more info. – coderanger Oct 14 '16 at 09:29
  • Thanks a lot for the information. – Navarro Oct 14 '16 at 12:07

1 Answers1

0

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.

loafdog
  • 101
  • 7