forked from CenturyLinkCloud/chef-provisioning-vsphere
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some better examples for everyone! Signed-off-by: JJ Asghar <[email protected]>
- Loading branch information
JJ Asghar
committed
Jun 15, 2017
1 parent
ee3a469
commit 88d97de
Showing
5 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
driver: | ||
name: vsphere | ||
driver_options: | ||
host: '172.16.20.2' | ||
user: '[email protected]' | ||
password: 'PASSWORD' | ||
insecure: true | ||
machine_options: | ||
start_timeout: 600 | ||
create_timeout: 600 | ||
ready_timeout: 90 | ||
bootstrap_options: | ||
use_linked_clone: true | ||
datacenter: 'Datacenter' | ||
template_name: 'ubuntu16' | ||
template_folder: 'Linux' | ||
resource_pool: 'Cluster' | ||
num_cpus: 2 | ||
memory_mb: 4096 | ||
ssh: | ||
user: ubuntu | ||
paranoid: false | ||
password: PASSWORD | ||
port: 22 | ||
|
||
provisioner: | ||
name: chef_zero | ||
sudo_command: sudo | ||
|
||
verifier: | ||
name: inspec | ||
|
||
transport: | ||
username: "admini" | ||
password: admini | ||
|
||
platforms: | ||
- name: ubuntu-16.04 | ||
|
||
suites: | ||
- name: default | ||
run_list: | ||
- recipe[vsphere_demo::default] | ||
attributes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
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: '[email protected]', | ||
password: 'PASSWORD' | ||
|
||
# | ||
# These are the machine_options that you need to declare | ||
# | ||
with_machine_options :bootstrap_options => { | ||
num_cpus: 2, | ||
memory_mb: 4096, | ||
datacenter: 'Datacenter', | ||
resource_pool: 'Cluster', | ||
template_folder: 'Linux', | ||
template_name: 'ubuntu16', | ||
:ssh => { | ||
:user => 'admini', | ||
:password => 'PASSWORD', | ||
:paranoid => false, | ||
} | ||
}, | ||
:sudo => true | ||
|
||
# | ||
# This is where you can declare the machine | ||
# | ||
machine "testing-ubuntu" do | ||
tag "haha" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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: '[email protected]', | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
driver: | ||
name: vsphere | ||
driver_options: | ||
host: '172.16.20.2' | ||
user: '[email protected]' | ||
password: 'PASSWORD' | ||
insecure: true | ||
machine_options: | ||
start_timeout: 600 | ||
create_timeout: 600 | ||
ready_timeout: 90 | ||
bootstrap_options: | ||
use_linked_clone: true | ||
datacenter: 'Datacenter' | ||
template_name: 'ubuntu16' | ||
template_folder: 'Linux' | ||
resource_pool: 'Cluster' | ||
num_cpus: 2 | ||
memory_mb: 4096 | ||
ssh: | ||
user: ubuntu | ||
paranoid: false | ||
password: 'PASSWORD' | ||
port: 22 | ||
|
||
provisioner: | ||
name: chef_zero | ||
sudo_command: sudo | ||
|
||
verifier: | ||
name: inspec | ||
|
||
transport: | ||
username: "ubuntu" | ||
password: 'PASSWORD' | ||
|
||
platforms: | ||
- name: ubuntu-16.04 | ||
- name: windows | ||
driver: | ||
machine_options: | ||
start_timeout: 600 | ||
create_timeout: 600 | ||
ready_timeout: 90 | ||
bootstrap_options: | ||
use_linked_clone: true | ||
datacenter: 'Datacenter' | ||
template_name: 'windows2012R2' | ||
template_folder: 'Windows' | ||
resource_pool: 'Cluster' | ||
num_cpus: 2 | ||
memory_mb: 8096 | ||
ssh: | ||
user: "administrator" | ||
paranoid: false | ||
password: "P@ssw0rd!!!!" | ||
port: 5985 | ||
|
||
suites: | ||
- name: default | ||
run_list: | ||
- recipe[my_cookbook::default] |