vagrant-softlayer 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -24
  3. data/QUICKSTART.md +377 -0
  4. data/README.md +25 -20
  5. data/contrib/README.md +8 -1
  6. data/contrib/vagrant-softlayer-boxes +416 -408
  7. data/contrib/vagrant-softlayer-vlans +329 -0
  8. data/contrib/vagrantcloud/CENTOS_5_32.box +0 -0
  9. data/contrib/vagrantcloud/CENTOS_5_64.box +0 -0
  10. data/contrib/vagrantcloud/CENTOS_6_32.box +0 -0
  11. data/contrib/vagrantcloud/CENTOS_6_64.box +0 -0
  12. data/contrib/vagrantcloud/CENTOS_LATEST.box +0 -0
  13. data/contrib/vagrantcloud/CENTOS_LATEST_32.box +0 -0
  14. data/contrib/vagrantcloud/CENTOS_LATEST_64.box +0 -0
  15. data/contrib/vagrantcloud/CLOUDLINUX_5_32.box +0 -0
  16. data/contrib/vagrantcloud/CLOUDLINUX_5_64.box +0 -0
  17. data/contrib/vagrantcloud/CLOUDLINUX_6_32.box +0 -0
  18. data/contrib/vagrantcloud/CLOUDLINUX_6_64.box +0 -0
  19. data/contrib/vagrantcloud/CLOUDLINUX_LATEST.box +0 -0
  20. data/contrib/vagrantcloud/CLOUDLINUX_LATEST_32.box +0 -0
  21. data/contrib/vagrantcloud/CLOUDLINUX_LATEST_64.box +0 -0
  22. data/contrib/vagrantcloud/DEBIAN_5_32.box +0 -0
  23. data/contrib/vagrantcloud/DEBIAN_5_64.box +0 -0
  24. data/contrib/vagrantcloud/DEBIAN_6_32.box +0 -0
  25. data/contrib/vagrantcloud/DEBIAN_6_64.box +0 -0
  26. data/contrib/vagrantcloud/DEBIAN_7_32.box +0 -0
  27. data/contrib/vagrantcloud/DEBIAN_7_64.box +0 -0
  28. data/contrib/vagrantcloud/DEBIAN_LATEST.box +0 -0
  29. data/contrib/vagrantcloud/DEBIAN_LATEST_32.box +0 -0
  30. data/contrib/vagrantcloud/DEBIAN_LATEST_64.box +0 -0
  31. data/contrib/vagrantcloud/REDHAT_5_32.box +0 -0
  32. data/contrib/vagrantcloud/REDHAT_5_64.box +0 -0
  33. data/contrib/vagrantcloud/REDHAT_6_32.box +0 -0
  34. data/contrib/vagrantcloud/REDHAT_6_64.box +0 -0
  35. data/contrib/vagrantcloud/REDHAT_LATEST.box +0 -0
  36. data/contrib/vagrantcloud/REDHAT_LATEST_32.box +0 -0
  37. data/contrib/vagrantcloud/REDHAT_LATEST_64.box +0 -0
  38. data/contrib/vagrantcloud/SL_GENERIC.box +0 -0
  39. data/contrib/vagrantcloud/UBUNTU_10_32.box +0 -0
  40. data/contrib/vagrantcloud/UBUNTU_10_64.box +0 -0
  41. data/contrib/vagrantcloud/UBUNTU_12_32.box +0 -0
  42. data/contrib/vagrantcloud/UBUNTU_12_64.box +0 -0
  43. data/contrib/vagrantcloud/UBUNTU_14_32.box +0 -0
  44. data/contrib/vagrantcloud/UBUNTU_14_64.box +0 -0
  45. data/contrib/vagrantcloud/UBUNTU_8_32.box +0 -0
  46. data/contrib/vagrantcloud/UBUNTU_8_64.box +0 -0
  47. data/contrib/vagrantcloud/UBUNTU_LATEST.box +0 -0
  48. data/contrib/vagrantcloud/UBUNTU_LATEST_32.box +0 -0
  49. data/contrib/vagrantcloud/UBUNTU_LATEST_64.box +0 -0
  50. data/contrib/vagrantcloud/VYATTACE_6.5_64.box +0 -0
  51. data/contrib/vagrantcloud/VYATTACE_6.6_64.box +0 -0
  52. data/contrib/vagrantcloud/VYATTACE_LATEST.box +0 -0
  53. data/contrib/vagrantcloud/VYATTACE_LATEST_64.box +0 -0
  54. data/contrib/vagrantcloud/WIN_2003-DC-SP2-1_32.box +0 -0
  55. data/contrib/vagrantcloud/WIN_2003-DC-SP2-1_64.box +0 -0
  56. data/contrib/vagrantcloud/WIN_2003-ENT-SP2-5_32.box +0 -0
  57. data/contrib/vagrantcloud/WIN_2003-ENT-SP2-5_64.box +0 -0
  58. data/contrib/vagrantcloud/WIN_2003-STD-SP2-5_32.box +0 -0
  59. data/contrib/vagrantcloud/WIN_2003-STD-SP2-5_64.box +0 -0
  60. data/contrib/vagrantcloud/WIN_2008-DC-R2_64.box +0 -0
  61. data/contrib/vagrantcloud/WIN_2008-DC-SP2_32.box +0 -0
  62. data/contrib/vagrantcloud/WIN_2008-DC-SP2_64.box +0 -0
  63. data/contrib/vagrantcloud/WIN_2008-ENT-R2_64.box +0 -0
  64. data/contrib/vagrantcloud/WIN_2008-ENT-SP2_32.box +0 -0
  65. data/contrib/vagrantcloud/WIN_2008-ENT-SP2_64.box +0 -0
  66. data/contrib/vagrantcloud/WIN_2008-STD-R2-SP1_64.box +0 -0
  67. data/contrib/vagrantcloud/WIN_2008-STD-R2_64.box +0 -0
  68. data/contrib/vagrantcloud/WIN_2008-STD-SP2_32.box +0 -0
  69. data/contrib/vagrantcloud/WIN_2008-STD-SP2_64.box +0 -0
  70. data/contrib/vagrantcloud/WIN_2012-DC_64.box +0 -0
  71. data/contrib/vagrantcloud/WIN_2012-STD_64.box +0 -0
  72. data/contrib/vagrantcloud/WIN_LATEST.box +0 -0
  73. data/contrib/vagrantcloud/WIN_LATEST_32.box +0 -0
  74. data/contrib/vagrantcloud/WIN_LATEST_64.box +0 -0
  75. data/lib/vagrant-softlayer/action.rb +20 -16
  76. data/lib/vagrant-softlayer/action/create_instance.rb +24 -8
  77. data/lib/vagrant-softlayer/action/setup_softlayer.rb +2 -1
  78. data/lib/vagrant-softlayer/action/sync_folders.rb +99 -99
  79. data/lib/vagrant-softlayer/action/wait_for_rebuild.rb +36 -36
  80. data/lib/vagrant-softlayer/config.rb +10 -2
  81. data/lib/vagrant-softlayer/errors.rb +33 -29
  82. data/lib/vagrant-softlayer/plugin.rb +77 -77
  83. data/lib/vagrant-softlayer/util/load_balancer.rb +103 -103
  84. data/lib/vagrant-softlayer/util/network.rb +75 -73
  85. data/lib/vagrant-softlayer/util/warden.rb +38 -38
  86. data/lib/vagrant-softlayer/version.rb +5 -5
  87. data/locales/en.yml +6 -0
  88. data/spec/vagrant-softlayer/config_spec.rb +4 -2
  89. data/vagrant-softlayer.gemspec +55 -55
  90. metadata +71 -2
Binary file
@@ -15,17 +15,17 @@ module VagrantPlugins
15
15
  b.use Call, DestroyConfirm do |env, b2|
16
16
  if env[:result]
17
17
  b2.use ConfigValidate
18
- b.use Call, Is, :not_created do |env2, b3|
18
+ b2.use Call, Is, :not_created do |env2, b3|
19
19
  if env2[:result]
20
20
  b3.use Message, :error, "vagrant_softlayer.vm.not_created"
21
- next
21
+ else
22
+ b3.use SetupSoftLayer
23
+ b3.use UpdateDNS
24
+ b3.use DestroyInstance
25
+ b3.use LoadBalancerCleanup
26
+ b3.use ProvisionerCleanup
22
27
  end
23
28
  end
24
- b2.use SetupSoftLayer
25
- b2.use UpdateDNS
26
- b2.use DestroyInstance
27
- b2.use LoadBalancerCleanup
28
- b2.use ProvisionerCleanup
29
29
  else
30
30
  b2.use Message, :warn, "vagrant_softlayer.vm.not_destroying"
31
31
  end
@@ -93,18 +93,18 @@ module VagrantPlugins
93
93
  b.use Call, Confirm, I18n.t("vagrant_softlayer.vm.rebuild_confirmation"), :force_rebuild do |env, b2|
94
94
  if env[:result]
95
95
  b2.use ConfigValidate
96
- b.use Call, Is, :not_created do |env2, b3|
96
+ b2.use Call, Is, :not_created do |env2, b3|
97
97
  if env2[:result]
98
98
  b3.use Message, :error, "vagrant_softlayer.vm.not_created"
99
- next
99
+ else
100
+ b3.use SetupSoftLayer
101
+ b3.use RebuildInstance
102
+ b3.use Provision
103
+ b3.use SyncFolders
104
+ b3.use WaitForRebuild
105
+ b3.use WaitForCommunicator
100
106
  end
101
107
  end
102
- b2.use SetupSoftLayer
103
- b2.use RebuildInstance
104
- b2.use Provision
105
- b2.use SyncFolders
106
- b2.use WaitForRebuild
107
- b2.use WaitForCommunicator
108
108
  else
109
109
  b2.use Message, :warn, "vagrant_softlayer.vm.not_rebuilding"
110
110
  end
@@ -184,7 +184,11 @@ module VagrantPlugins
184
184
  # This action is called to bring the box up from nothing.
185
185
  def self.action_up
186
186
  Vagrant::Action::Builder.new.tap do |b|
187
- b.use HandleBoxUrl
187
+ if defined?(HandleBox)
188
+ b.use HandleBox
189
+ else
190
+ b.use HandleBoxUrl
191
+ end
188
192
  b.use ConfigValidate
189
193
  b.use SetupSoftLayer
190
194
  b.use Call, Is, :not_created do |env1, b1|
@@ -27,6 +27,22 @@ module VagrantPlugins
27
27
  @env[:machine].provider_config.hostname || @env[:machine].config.vm.hostname
28
28
  end
29
29
 
30
+ def get_vlan_id(vlan_name, vlan_space)
31
+ return vlan_name unless vlan_name.kind_of?(String)
32
+
33
+ routers = @env[:sl_account].object_mask("mask[routers,routers.datacenter,routers.networkVlans,routers.networkVlans.networkSpace,routers.networkVlans.type]").getObject["routers"]
34
+
35
+ routers.each do |router|
36
+ next if @env[:machine].provider_config.datacenter && router["datacenter"]["name"] != @env[:machine].provider_config.datacenter
37
+ router["networkVlans"].each do |vlan|
38
+ vlan_qualified_name = [ router["hostname"].split('.').reverse.join('.'), vlan["vlanNumber"] ].join('.')
39
+ return vlan["id"] if vlan.has_key?("name") && vlan["type"]["keyName"] == "STANDARD" && vlan["networkSpace"] == vlan_space.to_s.upcase && (vlan["name"] == vlan_name || vlan_qualified_name == vlan_name)
40
+ end
41
+ end
42
+
43
+ raise Errors::SLVlanIdNotFound, :vlan_space => vlan_space.to_s, :vlan_name => vlan_name.inspect
44
+ end
45
+
30
46
  def order_template
31
47
  template = {
32
48
  "dedicatedAccountHostOnlyFlag" => @env[:machine].provider_config.dedicated,
@@ -41,14 +57,14 @@ module VagrantPlugins
41
57
  "startCpus" => @env[:machine].provider_config.start_cpus
42
58
  }
43
59
 
44
- template["blockDevices"] = @env[:machine].provider_config.disk_capacity.map{ |key,value| { "device"=> key.to_s, "diskImage" => { "capacity" => value.to_s } } } if @env[:machine].provider_config.disk_capacity
45
- template["datacenter"] = { :name => @env[:machine].provider_config.datacenter } if @env[:machine].provider_config.datacenter
46
- template["blockDeviceTemplateGroup"] = { :globalIdentifier => @env[:machine].provider_config.image_guid } if @env[:machine].provider_config.image_guid
47
- template["operatingSystemReferenceCode"] = @env[:machine].provider_config.operating_system if !@env[:machine].provider_config.image_guid
48
- template["postInstallScriptUri"] = @env[:machine].provider_config.post_install if @env[:machine].provider_config.post_install
49
- template["primaryNetworkComponent"] = { :networkVlan => { :id => @env[:machine].provider_config.vlan_public } } if @env[:machine].provider_config.vlan_public
50
- template["primaryBackendNetworkComponent"] = { :networkVlan => { :id => @env[:machine].provider_config.vlan_private } } if @env[:machine].provider_config.vlan_private
51
- template["userData"] = [ { :value => @env[:machine].provider_config.user_data } ] if @env[:machine].provider_config.user_data
60
+ template["blockDevices"] = @env[:machine].provider_config.disk_capacity.map{ |key,value| { "device"=> key.to_s, "diskImage" => { "capacity" => value.to_s } } } if @env[:machine].provider_config.disk_capacity
61
+ template["blockDeviceTemplateGroup"] = { :globalIdentifier => @env[:machine].provider_config.image_guid } if @env[:machine].provider_config.image_guid
62
+ template["datacenter"] = { :name => @env[:machine].provider_config.datacenter } if @env[:machine].provider_config.datacenter
63
+ template["operatingSystemReferenceCode"] = @env[:machine].provider_config.operating_system if !@env[:machine].provider_config.image_guid
64
+ template["postInstallScriptUri"] = @env[:machine].provider_config.post_install if @env[:machine].provider_config.post_install
65
+ template["primaryBackendNetworkComponent"] = { :networkVlan => { :id => get_vlan_id(@env[:machine].provider_config.vlan_private, :private) } } if @env[:machine].provider_config.vlan_private
66
+ template["primaryNetworkComponent"] = { :networkVlan => { :id => get_vlan_id(@env[:machine].provider_config.vlan_public, :public) } } if @env[:machine].provider_config.vlan_public
67
+ template["userData"] = [ { :value => @env[:machine].provider_config.user_data } ] if @env[:machine].provider_config.user_data
52
68
 
53
69
  return template
54
70
  end
@@ -22,8 +22,9 @@ module VagrantPlugins
22
22
  :username => env[:machine].provider_config.username
23
23
  }
24
24
 
25
- env[:sl_virtual_guest] = ::SoftLayer::Service.new("SoftLayer_Virtual_Guest", env[:sl_credentials])
25
+ env[:sl_account] = ::SoftLayer::Service.new("SoftLayer_Account", env[:sl_credentials])
26
26
  env[:sl_product_order] = ::SoftLayer::Service.new("SoftLayer_Product_Order", env[:sl_credentials])
27
+ env[:sl_virtual_guest] = ::SoftLayer::Service.new("SoftLayer_Virtual_Guest", env[:sl_credentials])
27
28
 
28
29
  unless env[:machine].id.nil? || env[:machine].id.empty?
29
30
  env[:sl_machine] = env[:sl_virtual_guest].object_with_id(env[:machine].id.to_i)
@@ -1,99 +1,99 @@
1
- require "log4r"
2
-
3
- require "vagrant/util/scoped_hash_override"
4
- require "vagrant/util/subprocess"
5
- require "vagrant/util/which"
6
-
7
- module VagrantPlugins
8
- module SoftLayer
9
- module Action
10
- # This middleware uses `rsync` to sync the folders over to the
11
- # SoftLayer instance.
12
- class SyncFolders
13
- include Vagrant::Util::ScopedHashOverride
14
-
15
- def initialize(app, env)
16
- @app = app
17
- @logger = Log4r::Logger.new("vagrant_softlayer::action::sync_folders")
18
- end
19
-
20
- def call(env)
21
- @app.call(env)
22
-
23
- ssh_info = env[:machine].ssh_info
24
-
25
- unless Vagrant::Util::Which.which("rsync")
26
- env[:ui].warn(I18n.t("vagrant_softlayer.sync_folders.rsync_not_found", :side => "host"))
27
- return
28
- end
29
-
30
- if env[:machine].communicate.execute("which rsync", :error_check => false) != 0
31
- env[:ui].warn(I18n.t("vagrant_softlayer.sync_folders.rsync_not_found", :side => "guest"))
32
- return
33
- end
34
-
35
- env[:machine].config.vm.synced_folders.each do |id, data|
36
- data = scoped_hash_override(data, :softlayer)
37
-
38
- # Ignore disabled shared folders
39
- next if data[:disabled]
40
-
41
- hostpath = File.expand_path(data[:hostpath], env[:root_path])
42
- guestpath = data[:guestpath]
43
-
44
- # Make sure there is a trailing slash on the host path to
45
- # avoid creating an additional directory with rsync
46
- hostpath = "#{hostpath}/" if hostpath !~ /\/$/
47
-
48
- # on windows rsync.exe requires cygdrive-style paths
49
- if Vagrant::Util::Platform.windows?
50
- hostpath = hostpath.gsub(/^(\w):/) { "/cygdrive/#{$1}" }
51
- end
52
-
53
- env[:ui].info(I18n.t("vagrant_softlayer.sync_folders.rsync_folder",
54
- :hostpath => hostpath,
55
- :guestpath => guestpath))
56
-
57
- # Create the host path if it doesn't exist and option flag is set
58
- if data[:create]
59
- begin
60
- FileUtils::mkdir_p(hostpath)
61
- rescue => err
62
- raise Errors::MkdirError,
63
- :hostpath => hostpath,
64
- :err => err
65
- end
66
- end
67
-
68
- # Create the guest path
69
- env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
70
- env[:machine].communicate.sudo(
71
- "chown #{ssh_info[:username]} '#{guestpath}'")
72
-
73
- # Rsync over to the guest path using the SSH info
74
- command = [
75
- "rsync", "--verbose", "--archive", "-z",
76
- "--exclude", ".vagrant/", "--exclude", "Vagrantfile",
77
- "-e", "ssh -p #{ssh_info[:port]} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path].join("' -i '")}'",
78
- hostpath,
79
- "#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
80
-
81
- # we need to fix permissions when using rsync.exe on windows, see
82
- # http://stackoverflow.com/questions/5798807/rsync-permission-denied-created-directories-have-no-permissions
83
- if Vagrant::Util::Platform.windows?
84
- command.insert(1, "--chmod", "ugo=rwX")
85
- end
86
-
87
- r = Vagrant::Util::Subprocess.execute(*command)
88
- if r.exit_code != 0
89
- raise Errors::RsyncError,
90
- :guestpath => guestpath,
91
- :hostpath => hostpath,
92
- :stderr => r.stderr
93
- end
94
- end
95
- end
96
- end
97
- end
98
- end
99
- end
1
+ require "log4r"
2
+
3
+ require "vagrant/util/scoped_hash_override"
4
+ require "vagrant/util/subprocess"
5
+ require "vagrant/util/which"
6
+
7
+ module VagrantPlugins
8
+ module SoftLayer
9
+ module Action
10
+ # This middleware uses `rsync` to sync the folders over to the
11
+ # SoftLayer instance.
12
+ class SyncFolders
13
+ include Vagrant::Util::ScopedHashOverride
14
+
15
+ def initialize(app, env)
16
+ @app = app
17
+ @logger = Log4r::Logger.new("vagrant_softlayer::action::sync_folders")
18
+ end
19
+
20
+ def call(env)
21
+ @app.call(env)
22
+
23
+ ssh_info = env[:machine].ssh_info
24
+
25
+ unless Vagrant::Util::Which.which("rsync")
26
+ env[:ui].warn(I18n.t("vagrant_softlayer.sync_folders.rsync_not_found", :side => "host"))
27
+ return
28
+ end
29
+
30
+ if env[:machine].communicate.execute("which rsync", :error_check => false) != 0
31
+ env[:ui].warn(I18n.t("vagrant_softlayer.sync_folders.rsync_not_found", :side => "guest"))
32
+ return
33
+ end
34
+
35
+ env[:machine].config.vm.synced_folders.each do |id, data|
36
+ data = scoped_hash_override(data, :softlayer)
37
+
38
+ # Ignore disabled shared folders
39
+ next if data[:disabled]
40
+
41
+ hostpath = File.expand_path(data[:hostpath], env[:root_path])
42
+ guestpath = data[:guestpath]
43
+
44
+ # Make sure there is a trailing slash on the host path to
45
+ # avoid creating an additional directory with rsync
46
+ hostpath = "#{hostpath}/" if hostpath !~ /\/$/
47
+
48
+ # on windows rsync.exe requires cygdrive-style paths
49
+ if Vagrant::Util::Platform.windows?
50
+ hostpath = hostpath.gsub(/^(\w):/) { "/cygdrive/#{$1}" }
51
+ end
52
+
53
+ env[:ui].info(I18n.t("vagrant_softlayer.sync_folders.rsync_folder",
54
+ :hostpath => hostpath,
55
+ :guestpath => guestpath))
56
+
57
+ # Create the host path if it doesn't exist and option flag is set
58
+ if data[:create]
59
+ begin
60
+ FileUtils::mkdir_p(hostpath)
61
+ rescue => err
62
+ raise Errors::MkdirError,
63
+ :hostpath => hostpath,
64
+ :err => err
65
+ end
66
+ end
67
+
68
+ # Create the guest path
69
+ env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
70
+ env[:machine].communicate.sudo(
71
+ "chown #{ssh_info[:username]} '#{guestpath}'")
72
+
73
+ # Rsync over to the guest path using the SSH info
74
+ command = [
75
+ "rsync", "--verbose", "--archive", "-z",
76
+ "--exclude", ".vagrant/", "--exclude", "Vagrantfile",
77
+ "-e", "ssh -p #{ssh_info[:port]} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path].join("' -i '")}'",
78
+ hostpath,
79
+ "#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
80
+
81
+ # we need to fix permissions when using rsync.exe on windows, see
82
+ # http://stackoverflow.com/questions/5798807/rsync-permission-denied-created-directories-have-no-permissions
83
+ if Vagrant::Util::Platform.windows?
84
+ command.insert(1, "--chmod", "ugo=rwX")
85
+ end
86
+
87
+ r = Vagrant::Util::Subprocess.execute(*command)
88
+ if r.exit_code != 0
89
+ raise Errors::RsyncError,
90
+ :guestpath => guestpath,
91
+ :hostpath => hostpath,
92
+ :stderr => r.stderr
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -1,36 +1,36 @@
1
- require "log4r"
2
-
3
- module VagrantPlugins
4
- module SoftLayer
5
- module Action
6
- # Waits until the new machine has been rebuilt.
7
- class WaitForRebuild
8
- include Util::Warden
9
-
10
- def initialize(app, env)
11
- @app = app
12
- @logger = Log4r::Logger.new("vagrant_softlayer::action::wait_for_rebuild")
13
- end
14
-
15
- def call(env)
16
- env[:ui].info I18n.t("vagrant_softlayer.vm.wait_for_rebuild")
17
-
18
- # 20 minutes timeout
19
- Timeout::timeout(1200) do
20
- @logger.debug("Checking if the instance has been rebuilt.")
21
- sl_warden do
22
- while env[:sl_machine].object_mask("activeTransactionCount").getObject["activeTransactionCount"] > 0
23
- @logger.debug("The machine is still being rebuilt. Retrying in 10 seconds.")
24
- sleep 10
25
- end
26
- end
27
- end
28
-
29
- env[:ui].info I18n.t("vagrant_softlayer.vm.rebuilt")
30
-
31
- @app.call(env)
32
- end
33
- end
34
- end
35
- end
36
- end
1
+ require "log4r"
2
+
3
+ module VagrantPlugins
4
+ module SoftLayer
5
+ module Action
6
+ # Waits until the new machine has been rebuilt.
7
+ class WaitForRebuild
8
+ include Util::Warden
9
+
10
+ def initialize(app, env)
11
+ @app = app
12
+ @logger = Log4r::Logger.new("vagrant_softlayer::action::wait_for_rebuild")
13
+ end
14
+
15
+ def call(env)
16
+ env[:ui].info I18n.t("vagrant_softlayer.vm.wait_for_rebuild")
17
+
18
+ # 20 minutes timeout
19
+ Timeout::timeout(1200) do
20
+ @logger.debug("Checking if the instance has been rebuilt.")
21
+ sl_warden do
22
+ while env[:sl_machine].object_mask("activeTransactionCount").getObject["activeTransactionCount"] > 0
23
+ @logger.debug("The machine is still being rebuilt. Retrying in 10 seconds.")
24
+ sleep 10
25
+ end
26
+ end
27
+ end
28
+
29
+ env[:ui].info I18n.t("vagrant_softlayer.vm.rebuilt")
30
+
31
+ @app.call(env)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -24,6 +24,9 @@ module VagrantPlugins
24
24
  # The domain of the instance.
25
25
  attr_accessor :domain
26
26
 
27
+ # Force the use of the private IP for all communication even if a public IP is available
28
+ attr_accessor :force_private_ip
29
+
27
30
  # The hostname of the instance.
28
31
  attr_accessor :hostname
29
32
 
@@ -60,10 +63,10 @@ module VagrantPlugins
60
63
  # User defined metadata string.
61
64
  attr_accessor :user_data
62
65
 
63
- # The ID of the private VLAN.
66
+ # The ID, name or qualified name of the private VLAN.
64
67
  attr_accessor :vlan_private
65
68
 
66
- # The ID of the public VLAN.
69
+ # The ID, name or qualified name of the public VLAN.
67
70
  attr_accessor :vlan_public
68
71
 
69
72
  # The load balancers service groups to join.
@@ -81,6 +84,7 @@ module VagrantPlugins
81
84
  @dedicated = UNSET_VALUE
82
85
  @disk_capacity = UNSET_VALUE
83
86
  @domain = UNSET_VALUE
87
+ @force_private_ip = UNSET_VALUE
84
88
  @hostname = UNSET_VALUE
85
89
  @image_guid = UNSET_VALUE
86
90
  @hourly_billing = UNSET_VALUE
@@ -154,6 +158,9 @@ module VagrantPlugins
154
158
  # Domain should be specified in Vagrantfile, so we set default to nil.
155
159
  @domain = nil if @domain == UNSET_VALUE
156
160
 
161
+ # Disable the use of force private IP so the default selection can take effect
162
+ @force_private_ip = false if @force_private_ip == UNSET_VALUE
163
+
157
164
  # Hostname should be specified in Vagrantfile, either using `config.vm.hostname`
158
165
  # or the provider specific configuration entry.
159
166
  @hostname = nil if @hostname == UNSET_VALUE
@@ -205,6 +212,7 @@ module VagrantPlugins
205
212
  def ssh_keys=(value)
206
213
  @ssh_key = value
207
214
  end
215
+
208
216
  alias_method :ssh_key_id=, :ssh_keys=
209
217
  alias_method :ssh_key_ids=, :ssh_keys=
210
218
  alias_method :ssh_key_name=, :ssh_keys=