-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting up vsphere driver once and calling it from different recipes #86
Comments
I'd recommend adding your common config settings to a hash. Then for each machine merge the config settings specific to that machine with your common settings into a new variable. Then pass that variable to the machine resource's |
speak English man |
I am very sorry. Let me try to be more clear. First I would create a variable to store your common options in a hash:
Now inside your
Hope that makes more sense |
1.upto(3) do |i| (so this will be used for up to 3 times?) |
here is what I got when I ran that above. all in the same file though? I am not sure if that is the way I am supposed to do it |
sorry.
Hope that helps. |
okay. cool thanks. |
WARN WinRM::WinRMWebService : WinRM::WinRMWebService#run_powershell_script is deprecated. Use WinRM::CommandExecutor#run_powershell_script instead |
I am having issues with the IP address, it keeps selecting the same one for theoretically machine_opts[:bootstrap_options][:customization_spec][:ip] = thanks On Thu, Sep 22, 2016 at 12:11 PM, Matt Wrock [email protected]
|
Try:
This clones the hash as it is sent to the machine instead of using the same variable in each iteration. |
should be
|
yeah that was from an earlier, I cought that mistake a while back but this is what I am using and still getting that error (minus the hash tag) #machine_batch "web" do |
is it possible to do this? to avoid that machine "DP-WEB83" do |
I realize that it will go much slower but until I can figure out why its not working |
sorry to keep bugging you, did you have a chance to look at that last email On Fri, Sep 23, 2016 at 10:47 AM, Matt Wrock [email protected]
|
sorry its been hectic on my end. I eventually actually want to test a machine_batch but yes. serializing the machines and not using a batch should get you past that. |
I tried using machine "DP-WEB83" do but it would only build one server, failed to customize the IP and then it On Fri, Sep 23, 2016 at 2:30 PM, Matt Wrock [email protected]
|
. On Tue, Sep 20, 2016 at 8:19 PM, Matt Wrock [email protected]
|
HELLOOOO |
Trying to get back to standards
Hi,
I am trying to deploy a server from chef-provisioning-vsphere using the example:
now I am trying to use the resource batch to build multiple vms at once and am having a hard time understanding how to set it up.
here is an example:
machine_batch do
action :setup
machines 'a', 'b', 'c', 'd', 'e',
recipe['chef-client::service']
end
I am using a template which has the chef-client installed and the client.rb file and cert and validator.pem
I want my new vms to have a: new IP, gateway, dns and join the domain.
After that is setup I want to run the chef-client cookbook to create the chef-client as a service to check in every so often and remove the validator.pem (that's part of the cookbook and should work as expected)
the recipes that I am struggling with are
example: Vcenter.rb
with_machine_options :bootstrap_options => {
use_linked_clone: true,
num_cpus: 2,
memory_mb: 4096,
network_name: ['vlan_20_172.21.20'],
datacenter: 'datacenter_name',
resource_pool: 'cluster',
template_name: 'path to template',
customization_spec: {
ipsettings: {
dnsServerList: ['1.2.3.31','1.2.3.41']
},
domain: 'blah.com',
domainAdmin: '[email protected]',
domainAdminPassword: 'Passwordyoyoyo',
org_name: 'acme',
product_id: 'CDAA-SSSC-3455-FF77-2AAC',
win_time_zone: 4
}
ssh: {
user: 'administrator',
password: 'password',
paranoid: false,
}
}
and the recipe that I want to use to build the new vms
newVMs.rb
machine_batch do
action :setup
machines 'a', 'b', 'c', 'd', 'e',
recipe['chef-client::service']
end
How can I use the newVMs.rb recipe without having all of the info that's on Vcenter.rb file. Instead reference to it somehow??? Tried include_recipe 'vms::VCenter'
i am getting this error:
Error executing action
converge
on resource 'machine[DS-TEST01]'================================================================================
the recipe that I want to use to build new vms, I want it to be clean all the machine_options and customization_specs I'd like to keep on a different file. this is for a windows environment by the way.
any help would be greatly appreciated.
thanks
The text was updated successfully, but these errors were encountered: