Sha256: c5e194130c0ed3481e840ed65d3cb48788959c9b29c51dd254d7a446c5097f7b

Contents?: true

Size: 1.54 KB

Versions: 9

Compression:

Stored size: 1.54 KB

Contents

require 'chef/provisioning'
require 'chef/provisioning/vsphere_driver'


#
# This is the main way to connect to vSphere
#
with_vsphere_driver host: '172.16.20.2',
  insecure: true,
  user:     'administrator@vsphere.local',
  password: 'PASSWORD'

#
# These are the machine_options that you need to declare
#
win_bootstrap_options = { :bootstrap_options => {
                            num_cpus: 2,
                            memory_mb: 8096,
                            datacenter: 'Datacenter',
                            resource_pool: 'Cluster',
                            template_folder: 'Windows',
                            template_name: 'windows2012R2',
                            :ssh => {
                              :user => 'Administrator',
                              :password => 'P@ssw0rd!!!',
                              :paranoid => false,
                              :port => "5985"
                            }
                          },
                          ssh_options: { :keepalive => true, :keepalive_interval => 50, :user_known_hosts_file => '/dev/null' },
                          ready_timeout: '30'
                        }

#
# WinRM requires a Chef server (not sure why) so you need to declare it here
#
with_chef_server "https://api.chef.io/organizations/ORG",
                 :client_name => Chef::Config[:node_name],
                 :signing_key_filename => Chef::Config[:client_key]

#
# This is where you can declare the machine
#
machine "testing-windows" do
  machine_options win_bootstrap_options
  tag "haha"
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
chef-provisioning-vsphere-2.2.2 examples/win-provision.rb
chef-provisioning-vsphere-2.2.1 examples/win-provision.rb
chef-provisioning-vsphere-2.2.0 examples/win-provision.rb
chef-provisioning-vsphere-2.1.0 examples/win-provision.rb
chef-provisioning-vsphere-2.0.10 examples/win-provision.rb
chef-provisioning-vsphere-2.0.9 examples/win-provision.rb
chef-provisioning-vsphere-2.0.8 examples/win-provision.rb
chef-provisioning-vsphere-2.0.7 examples/win-provision.rb
chef-provisioning-vsphere-2.0.6 examples/win-provision.rb