Skip to content

Instantly share code, notes, and snippets.

@yvovandoorn
Last active October 7, 2015 09:43
Show Gist options
  • Save yvovandoorn/519f91d84e786fe4b5d7 to your computer and use it in GitHub Desktop.
Save yvovandoorn/519f91d84e786fe4b5d7 to your computer and use it in GitHub Desktop.
Chef Metal & Machine config

Updates to DevOps for VMware Administrators – Chapter 9

Overview

This gist will contain updates to the Chef Provisioning portion located in Chapter 9 of the 1st edition of “DevOps for VMWare Administrators"

The chapter has a warning on page 136 warning users due to the heavy development of Chef Provisioning that the instructions may no longer work. This gist is to capture the changes and allow the instructions to work.

Changes (last updated: 5 October 2015)

  • Combined use of provisioning driver & machine recipes

    • No need for two files (like done in book)

    • Recipes become one stop artifacts for the cloud they are deployed in

      • The chapter originally highlights the benefits of keep these two separate. Real world feedback suggests users like the provisioning driver to live with the machine recipe.
  • Examples still used ‘chef_metal_vsphere’ but the driver has been renamed to: ‘require 'chef/provisioning/vsphere_driver'.

    • Development between original publication to today changed:

      • The way drivers are organized and found to avoid namespace collisions

      • Product was renamed from ‘chef metal’ to ‘chef provisioning’ and these naming changes were made aggressively in the core product.

  • Resource name changed from ‘with_vsphere_provisioner’ to ‘with_vsphere_driver’

    • Property name changed from ‘vsphere_host’ to ‘host’
  • Resource name changed from ‘with_provisioner_options’ to ‘with_machine_options’

Notice: You no longer need *machine.rb* in order for your Chef Provisioning
example from the 1st edition of *“DevOps for VMWare Administrators”* to work.
**See README.md for more information**
require 'chef/provisioning/vsphere_driver'
with_chef_server "https://api.opscode.com",
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
with_vsphere_driver host: 'vcenter-host-name',
insecure: true,
user: 'you_user_name',
password: 'your_password'
with_machine_options :bootstrap_options => {
use_linked_clone: true,
num_cpus: 2,
memory_mb: 4096,
network_name: ["your_network_name_here"],
datacenter: 'datacenter_name',
resource_pool: 'cluster',
template_name: 'path to template',
customization_spec: {
ipsettings: {
dnsServerList: ['dns.server.ip.address1','dns.server.ip.address2']
},
:domain => 'local'
}
:ssh => {
:user => 'root',
:password => 'password',
:paranoid => false,
}
}
1.upto 2 do |n|
machine "metal_#{n}" do
action [:create]
recipe 'ntp'
converge true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment