Advertisement
Guest User

Untitled

a guest
Dec 24th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. #Hi,
  2. #
  3. #Seems like my other issue has been closed without my questions being answered.
  4. #
  5. #All I want to know IS IT POSSIBLE TO BUILD MULTIPLE WINDOWS SERVERS USING CHEF-PROVISIONING-VSPHERE???
  6. #
  7. #how do I modify this example you've provided to customize IPs on all the servers and join them to the domain. I want to be able to build let's say 10 servers with custom IP, name, and domain etc
  8. #
  9. #
  10. chef_gem 'chef-provisioning-vsphere' do
  11. action :install
  12. compile_time true
  13. end
  14.  
  15. require 'chef/provisioning/vsphere_driver'
  16.  
  17. with_vsphere_driver host: '127.0.0.1',
  18. insecure: true,
  19. user: 'boomer',
  20. password: 'sooner'
  21.  
  22.  
  23. #Williamson 12-15-15 Big Hash value shared between machines
  24. shared_options = {
  25. :bootstrap_options => {
  26. use_linked_clone: false,
  27. network_name: ['vlan_20_172.21.20'],
  28. datacenter: 'devops',
  29. datastore: 'superfast',
  30. resource_pool: 'devops_Production_Cluster_01',
  31. vm_folder: 'Organizational Units/DEVOPS',
  32. template_name: 'flark',
  33. customization_spec: {
  34. ipsettings: {
  35. gateway: ["10.100.1.1"],
  36. dnsServerList: ['10.100.1.20'],
  37.  
  38. },
  39. domain: 'blah.com',
  40. domainAdmin: 'administrator@blah.com',
  41. domainAdminPassword: 'Passwordyoyoyo',
  42. org_name: 'acme',
  43. product_id: 'CDAA-87DC-3455-FF77-2AAC',
  44. win_time_zone: 4
  45. },
  46. :ssh => {
  47. :user => 'administrator',
  48. :password => 'password',
  49. :paranoid => false,
  50. },
  51.  
  52. :convergence_options => {
  53. :ssl_verify_mode => :verify_none
  54. }
  55. }
  56. }
  57.  
  58. machine_batch do
  59. custom_options = shared_options.dup
  60. 1.upto(10) do |i|
  61. #Count from 10.100.90.21 to 30
  62. custom_options[:customization_spec][:ipsettings][:ip]="10.100.90.2#{i}"
  63. machines %w(Web1 DC1 SQL1 DC2 Web50 ChefWS1 ChefWS05 Gold Silver L1E5DVOP) do
  64. machine_options custom_options
  65. run_list ["recipe[chefrules::sqlmp4]"]
  66. end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement