Class: VagrantPlugins::Openstack::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Openstack::Config
- Defined in:
- lib/vagrant-openstack-provider/config.rb
Instance Attribute Summary collapse
-
#availability_zone ⇒ String
Availability Zone.
-
#domain_name ⇒ String
The domain name to access Openstack, this defaults to Default.
-
#endpoint_type ⇒ String
Specify the endpoint_type to use : publicURL, adminURL, or internalURL (default is publicURL).
-
#flavor ⇒ Object
The flavor of server to launch, either the ID or name.
-
#floating_ip ⇒ String
The floating IP address from the IP pool which will be assigned to the instance.
- #floating_ip_assign_timeout ⇒ Integer
-
#floating_ip_pool ⇒ String
The floating IP pool from where new IPs will be allocated.
-
#floating_ip_pool_always_allocate ⇒ Boolean
if set to true, vagrant will always allocate floating ip instead of trying to reuse unassigned ones default to false.
- #http ⇒ HttpConfig
-
#identity_api_version ⇒ String
Specify the authentication version to use : 2 or 3 (ddefault is 2().
-
#image ⇒ Object
The name or ID of the image to use.
-
#interface_type ⇒ String
Specify the endpoint_type to use : publicL, admin, or internal (default is public).
-
#keypair_name ⇒ String
The name of the keypair to use.
- #meta_args_support ⇒ Boolean
-
#metadata ⇒ Hash
A Hash of metadata that will be sent to the instance for configuration.
-
#networks ⇒ Array
Network list the VM will be connected to.
-
#openstack_auth_url ⇒ Object
The authentication endpoint.
-
#openstack_compute_url ⇒ Object
The compute service url to access Openstack.
-
#openstack_image_url ⇒ Object
The image service url to access Openstack.
-
#openstack_network_url ⇒ Object
The network service url to access Openstack.
-
#openstack_orchestration_url ⇒ Object
The orchestration service url to access Openstack.
-
#openstack_volume_url ⇒ Object
The block storage service url to access Openstack.
-
#password ⇒ Object
The API key to access Openstack.
-
#project_name ⇒ Object
The name of the openstack project on witch the vm will be created, changed name in v3 identity API.
-
#public_key_path ⇒ Array
Public key path to create OpenStack keypair.
-
#region ⇒ Object
Openstack region.
-
#rsync_ignore_files ⇒ Array
deprecated
Deprecated.
Use standard Vagrant synced folders instead.
-
#rsync_includes ⇒ Array
deprecated
Deprecated.
Use standard Vagrant synced folders instead.
-
#scheduler_hints ⇒ Object
Pass hints to the OpenStack scheduler, e.g.
-
#security_groups ⇒ Array[String]
List of strings representing the security groups to apply.
- #server_active_timeout ⇒ Integer
- #server_create_timeout ⇒ Integer
- #server_delete_timeout ⇒ Integer
-
#server_name ⇒ Object
The name of the server.
- #server_stop_timeout ⇒ Integer
-
#ssh_disabled ⇒ Boolean
Flag to enable/disable all SSH actions (to use for instance on private networks).
-
#ssh_timeout ⇒ Integer
The SSH timeout use after server creation.
-
#ssh_username ⇒ String
The SSH username to use with this OpenStack instance.
-
#ssl_ca_file ⇒ String
Specify the certificate to use.
-
#ssl_verify_peer ⇒ Boolean
Verify ssl peer certificate when connecting.
- #stack_create_timeout ⇒ Integer
- #stack_delete_timeout ⇒ Integer
-
#stacks ⇒ Array
Stack that will be created and associated to the instances.
-
#sync_method ⇒ String
deprecated
Deprecated.
Use standard Vagrant synced folders instead.
-
#tenant_name ⇒ Object
The name of the openstack project on witch the vm will be created.
-
#use_legacy_synced_folders ⇒ Boolean
deprecated
Deprecated.
Use standard Vagrant synced folders instead.
-
#user_data ⇒ String
User data to be sent to the newly created OpenStack instance.
-
#username ⇒ String
The username to access Openstack.
-
#volume_boot ⇒ Object
Volume to boot the vm from.
-
#volumes ⇒ Array
Volumes list that will be attached to the VM.
Instance Method Summary collapse
-
#finalize! ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity.
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #merge(other) ⇒ Object
-
#rsync_include(inc) ⇒ Object
deprecated
Deprecated.
Use standard Vagrant synced folders instead.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/vagrant-openstack-provider/config.rb', line 256 def initialize @password = UNSET_VALUE @openstack_compute_url = UNSET_VALUE @openstack_network_url = UNSET_VALUE @openstack_volume_url = UNSET_VALUE @openstack_orchestration_url = UNSET_VALUE @openstack_image_url = UNSET_VALUE @openstack_auth_url = UNSET_VALUE @endpoint_type = UNSET_VALUE @interface_type = UNSET_VALUE @identity_api_version = UNSET_VALUE @region = UNSET_VALUE @flavor = UNSET_VALUE @image = UNSET_VALUE @volume_boot = UNSET_VALUE @tenant_name = UNSET_VALUE @server_name = UNSET_VALUE @username = UNSET_VALUE @rsync_includes = [] @rsync_ignore_files = [] @keypair_name = UNSET_VALUE @ssh_username = UNSET_VALUE @ssh_timeout = UNSET_VALUE @floating_ip = UNSET_VALUE @floating_ip_pool = [] @floating_ip_pool_always_allocate = UNSET_VALUE @sync_method = UNSET_VALUE @availability_zone = UNSET_VALUE @networks = [] @stacks = [] @volumes = [] @public_key_path = UNSET_VALUE @scheduler_hints = UNSET_VALUE @security_groups = UNSET_VALUE @user_data = UNSET_VALUE @metadata = UNSET_VALUE @ssh_disabled = UNSET_VALUE @server_create_timeout = UNSET_VALUE @server_active_timeout = UNSET_VALUE @server_stop_timeout = UNSET_VALUE @server_delete_timeout = UNSET_VALUE @stack_create_timeout = UNSET_VALUE @stack_delete_timeout = UNSET_VALUE @floating_ip_assign_timeout = UNSET_VALUE @meta_args_support = UNSET_VALUE @http = HttpConfig.new @use_legacy_synced_folders = UNSET_VALUE @ssl_ca_file = UNSET_VALUE @ssl_verify_peer = UNSET_VALUE end |
Instance Attribute Details
#availability_zone ⇒ String
Availability Zone
154 155 156 |
# File 'lib/vagrant-openstack-provider/config.rb', line 154 def availability_zone @availability_zone end |
#domain_name ⇒ String
The domain name to access Openstack, this defaults to Default.
73 74 75 |
# File 'lib/vagrant-openstack-provider/config.rb', line 73 def domain_name @domain_name end |
#endpoint_type ⇒ String
Specify the endpoint_type to use : publicURL, adminURL, or internalURL (default is publicURL)
184 185 186 |
# File 'lib/vagrant-openstack-provider/config.rb', line 184 def endpoint_type @endpoint_type end |
#flavor ⇒ Object
The flavor of server to launch, either the ID or name. This can also be a regular expression to partially match a name.
40 41 42 |
# File 'lib/vagrant-openstack-provider/config.rb', line 40 def flavor @flavor end |
#floating_ip ⇒ String
The floating IP address from the IP pool which will be assigned to the instance.
103 104 105 |
# File 'lib/vagrant-openstack-provider/config.rb', line 103 def floating_ip @floating_ip end |
#floating_ip_assign_timeout ⇒ Integer
222 223 224 |
# File 'lib/vagrant-openstack-provider/config.rb', line 222 def floating_ip_assign_timeout @floating_ip_assign_timeout end |
#floating_ip_pool ⇒ String
The floating IP pool from where new IPs will be allocated
108 109 110 |
# File 'lib/vagrant-openstack-provider/config.rb', line 108 def floating_ip_pool @floating_ip_pool end |
#floating_ip_pool_always_allocate ⇒ Boolean
if set to true, vagrant will always allocate floating ip instead of trying to reuse unassigned ones default to false
114 115 116 |
# File 'lib/vagrant-openstack-provider/config.rb', line 114 def floating_ip_pool_always_allocate @floating_ip_pool_always_allocate end |
#http ⇒ HttpConfig
226 227 228 |
# File 'lib/vagrant-openstack-provider/config.rb', line 226 def http @http end |
#identity_api_version ⇒ String
Specify the authentication version to use : 2 or 3 (ddefault is 2()
194 195 196 |
# File 'lib/vagrant-openstack-provider/config.rb', line 194 def identity_api_version @identity_api_version end |
#image ⇒ Object
The name or ID of the image to use. This can also be a regular expression to partially match a name.
44 45 46 |
# File 'lib/vagrant-openstack-provider/config.rb', line 44 def image @image end |
#interface_type ⇒ String
Specify the endpoint_type to use : publicL, admin, or internal (default is public)
189 190 191 |
# File 'lib/vagrant-openstack-provider/config.rb', line 189 def interface_type @interface_type end |
#keypair_name ⇒ String
The name of the keypair to use.
78 79 80 |
# File 'lib/vagrant-openstack-provider/config.rb', line 78 def keypair_name @keypair_name end |
#meta_args_support ⇒ Boolean
230 231 232 |
# File 'lib/vagrant-openstack-provider/config.rb', line 230 def @meta_args_support end |
#metadata ⇒ Hash
A Hash of metadata that will be sent to the instance for configuration
174 175 176 |
# File 'lib/vagrant-openstack-provider/config.rb', line 174 def @metadata end |
#networks ⇒ Array
Network list the VM will be connected to
134 135 136 |
# File 'lib/vagrant-openstack-provider/config.rb', line 134 def networks @networks end |
#openstack_auth_url ⇒ Object
The authentication endpoint. This defaults to Openstack’s global authentication endpoint.
33 34 35 |
# File 'lib/vagrant-openstack-provider/config.rb', line 33 def openstack_auth_url @openstack_auth_url end |
#openstack_compute_url ⇒ Object
The compute service url to access Openstack. If nil, it will read from hypermedia catalog form REST API
14 15 16 |
# File 'lib/vagrant-openstack-provider/config.rb', line 14 def openstack_compute_url @openstack_compute_url end |
#openstack_image_url ⇒ Object
The image service url to access Openstack. If nil, it will read from hypermedia catalog form REST API
30 31 32 |
# File 'lib/vagrant-openstack-provider/config.rb', line 30 def openstack_image_url @openstack_image_url end |
#openstack_network_url ⇒ Object
The network service url to access Openstack. If nil, it will read from hypermedia catalog form REST API
18 19 20 |
# File 'lib/vagrant-openstack-provider/config.rb', line 18 def openstack_network_url @openstack_network_url end |
#openstack_orchestration_url ⇒ Object
The orchestration service url to access Openstack. If nil, it will read from hypermedia catalog form REST API
26 27 28 |
# File 'lib/vagrant-openstack-provider/config.rb', line 26 def openstack_orchestration_url @openstack_orchestration_url end |
#openstack_volume_url ⇒ Object
The block storage service url to access Openstack. If nil, it will read from hypermedia catalog form REST API
22 23 24 |
# File 'lib/vagrant-openstack-provider/config.rb', line 22 def openstack_volume_url @openstack_volume_url end |
#password ⇒ Object
The API key to access Openstack.
10 11 12 |
# File 'lib/vagrant-openstack-provider/config.rb', line 10 def password @password end |
#project_name ⇒ Object
The name of the openstack project on witch the vm will be created, changed name in v3 identity API.
58 59 60 |
# File 'lib/vagrant-openstack-provider/config.rb', line 58 def project_name @project_name end |
#public_key_path ⇒ Array
Public key path to create OpenStack keypair
149 150 151 |
# File 'lib/vagrant-openstack-provider/config.rb', line 149 def public_key_path @public_key_path end |
#region ⇒ Object
Openstack region
36 37 38 |
# File 'lib/vagrant-openstack-provider/config.rb', line 36 def region @region end |
#rsync_ignore_files ⇒ Array
Use standard Vagrant synced folders instead.
Sync folder ignore files. A list of files containing exclude patterns to ignore in the rsync operation
performed by this provider
129 130 131 |
# File 'lib/vagrant-openstack-provider/config.rb', line 129 def rsync_ignore_files @rsync_ignore_files end |
#rsync_includes ⇒ Array
Use standard Vagrant synced folders instead.
Opt files/directories in to the rsync operation performed by this provider
98 99 100 |
# File 'lib/vagrant-openstack-provider/config.rb', line 98 def rsync_includes @rsync_includes end |
#scheduler_hints ⇒ Object
Pass hints to the OpenStack scheduler, e.g. { “cell”: “some cell name” }
157 158 159 |
# File 'lib/vagrant-openstack-provider/config.rb', line 157 def scheduler_hints @scheduler_hints end |
#security_groups ⇒ Array[String]
List of strings representing the security groups to apply. e.g. [‘ssh’, ‘http’]
163 164 165 |
# File 'lib/vagrant-openstack-provider/config.rb', line 163 def security_groups @security_groups end |
#server_active_timeout ⇒ Integer
202 203 204 |
# File 'lib/vagrant-openstack-provider/config.rb', line 202 def server_active_timeout @server_active_timeout end |
#server_create_timeout ⇒ Integer
198 199 200 |
# File 'lib/vagrant-openstack-provider/config.rb', line 198 def server_create_timeout @server_create_timeout end |
#server_delete_timeout ⇒ Integer
210 211 212 |
# File 'lib/vagrant-openstack-provider/config.rb', line 210 def server_delete_timeout @server_delete_timeout end |
#server_name ⇒ Object
The name of the server. This defaults to the name of the machine defined by Vagrant (via ‘config.vm.define`), but can be overriden here.
63 64 65 |
# File 'lib/vagrant-openstack-provider/config.rb', line 63 def server_name @server_name end |
#server_stop_timeout ⇒ Integer
206 207 208 |
# File 'lib/vagrant-openstack-provider/config.rb', line 206 def server_stop_timeout @server_stop_timeout end |
#ssh_disabled ⇒ Boolean
Flag to enable/disable all SSH actions (to use for instance on private networks)
179 180 181 |
# File 'lib/vagrant-openstack-provider/config.rb', line 179 def ssh_disabled @ssh_disabled end |
#ssh_timeout ⇒ Integer
The SSH timeout use after server creation.
Deprecated. Use config.vm.boot_timeout instead.
91 92 93 |
# File 'lib/vagrant-openstack-provider/config.rb', line 91 def ssh_timeout @ssh_timeout end |
#ssh_username ⇒ String
The SSH username to use with this OpenStack instance. This overrides the ‘config.ssh.username` variable.
84 85 86 |
# File 'lib/vagrant-openstack-provider/config.rb', line 84 def ssh_username @ssh_username end |
#ssl_ca_file ⇒ String
Specify the certificate to use.
249 250 251 |
# File 'lib/vagrant-openstack-provider/config.rb', line 249 def ssl_ca_file @ssl_ca_file end |
#ssl_verify_peer ⇒ Boolean
Verify ssl peer certificate when connecting. Set to false (! unsecure) to disable
254 255 256 |
# File 'lib/vagrant-openstack-provider/config.rb', line 254 def ssl_verify_peer @ssl_verify_peer end |
#stack_create_timeout ⇒ Integer
214 215 216 |
# File 'lib/vagrant-openstack-provider/config.rb', line 214 def stack_create_timeout @stack_create_timeout end |
#stack_delete_timeout ⇒ Integer
218 219 220 |
# File 'lib/vagrant-openstack-provider/config.rb', line 218 def stack_delete_timeout @stack_delete_timeout end |
#stacks ⇒ Array
Stack that will be created and associated to the instances
144 145 146 |
# File 'lib/vagrant-openstack-provider/config.rb', line 144 def stacks @stacks end |
#sync_method ⇒ String
Use standard Vagrant synced folders instead.
Sync folder method. Can be either “rsync” or “none”
121 122 123 |
# File 'lib/vagrant-openstack-provider/config.rb', line 121 def sync_method @sync_method end |
#tenant_name ⇒ Object
The name of the openstack project on witch the vm will be created.
53 54 55 |
# File 'lib/vagrant-openstack-provider/config.rb', line 53 def tenant_name @tenant_name end |
#use_legacy_synced_folders ⇒ Boolean
Use standard Vagrant synced folders instead.
A switch for enabling the legacy synced folders implementation.
This defaults to false, but is automatically set to true if any of the legacy synced folder options are used:
- {#rsync_includes}
- {#rsync_ignore_files}
- {#sync_method}
244 245 246 |
# File 'lib/vagrant-openstack-provider/config.rb', line 244 def use_legacy_synced_folders @use_legacy_synced_folders end |
#user_data ⇒ String
User data to be sent to the newly created OpenStack instance. Use this e.g. to inject a script at boot time.
169 170 171 |
# File 'lib/vagrant-openstack-provider/config.rb', line 169 def user_data @user_data end |
#username ⇒ String
The username to access Openstack.
68 69 70 |
# File 'lib/vagrant-openstack-provider/config.rb', line 68 def username @username end |
#volume_boot ⇒ Object
Volume to boot the vm from
48 49 50 |
# File 'lib/vagrant-openstack-provider/config.rb', line 48 def volume_boot @volume_boot end |
#volumes ⇒ Array
Volumes list that will be attached to the VM
139 140 141 |
# File 'lib/vagrant-openstack-provider/config.rb', line 139 def volumes @volumes end |
Instance Method Details
#finalize! ⇒ Object
rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/vagrant-openstack-provider/config.rb', line 346 def finalize! @password = nil if @password == UNSET_VALUE @openstack_compute_url = nil if @openstack_compute_url == UNSET_VALUE @openstack_network_url = nil if @openstack_network_url == UNSET_VALUE @openstack_orchestration_url = nil if @openstack_orchestration_url == UNSET_VALUE @openstack_volume_url = nil if @openstack_volume_url == UNSET_VALUE @openstack_image_url = nil if @openstack_image_url == UNSET_VALUE @openstack_auth_url = nil if @openstack_auth_url == UNSET_VALUE @endpoint_type = 'publicURL' if @endpoint_type == UNSET_VALUE @interface_type = 'public' if @interface_type == UNSET_VALUE @identity_api_version = '2' if @identity_api_version == UNSET_VALUE @region = nil if @region == UNSET_VALUE @flavor = nil if @flavor == UNSET_VALUE @image = nil if @image == UNSET_VALUE @volume_boot = nil if @volume_boot == UNSET_VALUE @tenant_name = nil if @tenant_name == UNSET_VALUE @project_name = nil if @project_name == UNSET_VALUE @server_name = nil if @server_name == UNSET_VALUE @username = nil if @username == UNSET_VALUE @domain_name = 'Default' if @domain_name == UNSET_VALUE @floating_ip = nil if @floating_ip == UNSET_VALUE @floating_ip_pool = nil if @floating_ip_pool == UNSET_VALUE @floating_ip_pool_always_allocate = false if floating_ip_pool_always_allocate == UNSET_VALUE @keypair_name = nil if @keypair_name == UNSET_VALUE @public_key_path = nil if @public_key_path == UNSET_VALUE @availability_zone = nil if @availability_zone == UNSET_VALUE @scheduler_hints = nil if @scheduler_hints == UNSET_VALUE @security_groups = nil if @security_groups == UNSET_VALUE @user_data = nil if @user_data == UNSET_VALUE @metadata = nil if @metadata == UNSET_VALUE @ssh_disabled = false if @ssh_disabled == UNSET_VALUE # The value of use_legacy_synced_folders is used by action chains # to determine which synced folder implementation to run. if @use_legacy_synced_folders == UNSET_VALUE @use_legacy_synced_folders = !( (@rsync_includes.nil? || @rsync_includes.empty?) && (@rsync_ignore_files.nil? || @rsync_ignore_files.empty?) && (@sync_method.nil? || @sync_method == UNSET_VALUE)) end if @use_legacy_synced_folders # Original defaults. @rsync_includes = nil if @rsync_includes.empty? @rsync_ignore_files = nil if @rsync_ignore_files.empty? @sync_method = 'rsync' if @sync_method == UNSET_VALUE else # Disable all sync settings. @rsync_includes = nil @rsync_ignore_files = nil @sync_method = nil end # The SSH values by default are nil, and the top-level config # `config.ssh` and `config.vm.boot_timeout` values are used. @ssh_username = nil if @ssh_username == UNSET_VALUE @ssh_timeout = nil if @ssh_timeout == UNSET_VALUE @server_create_timeout = 200 if @server_create_timeout == UNSET_VALUE @server_active_timeout = 200 if @server_active_timeout == UNSET_VALUE @server_stop_timeout = 200 if @server_stop_timeout == UNSET_VALUE @server_delete_timeout = 200 if @server_delete_timeout == UNSET_VALUE @stack_create_timeout = 200 if @stack_create_timeout == UNSET_VALUE @stack_delete_timeout = 200 if @stack_delete_timeout == UNSET_VALUE @floating_ip_assign_timeout = 200 if @floating_ip_assign_timeout == UNSET_VALUE @meta_args_support = false if @meta_args_support == UNSET_VALUE @networks = nil if @networks.empty? @volumes = nil if @volumes.empty? @stacks = nil if @stacks.empty? @http.finalize! @ssl_ca_file = nil if @ssl_ca_file == UNSET_VALUE @ssl_verify_peer = true if @ssl_verify_peer == UNSET_VALUE end |
#merge(other) ⇒ Object
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/vagrant-openstack-provider/config.rb', line 307 def merge(other) result = self.class.new # Set all of our instance variables on the new class [self, other].each do |obj| obj.instance_variables.each do |key| # Ignore keys that start with a double underscore. This allows # configuration classes to still hold around internal state # that isn't propagated. next if key.to_s.start_with?('@__') # Let user inputs a string or an array for floating ip pool attribute obj.floating_ip_pool = [obj.floating_ip_pool].flatten if key.eql?(:@floating_ip_pool) && !obj.floating_ip_pool.nil? # Let user inputs a string or an array for networks attribute obj.networks = [obj.networks].flatten if key.eql?(:@networks) && !obj.networks.nil? # Don't set the value if it is the unset value, either. value = obj.instance_variable_get(key) if [:@networks, :@volumes, :@rsync_includes, :@rsync_ignore_files, :@floating_ip_pool, :@stacks].include? key result.instance_variable_set(key, value) unless value.empty? elsif [:@http].include? key result.instance_variable_set(key, instance_variable_get(key).merge(other.instance_variable_get(key))) if value != UNSET_VALUE else result.instance_variable_set(key, value) if value != UNSET_VALUE end end end # Persist through the set of invalid methods this_invalid = @__invalid_methods || Set.new other_invalid = other.instance_variable_get(:"@__invalid_methods") || Set.new result.instance_variable_set(:"@__invalid_methods", this_invalid + other_invalid) result end |
#rsync_include(inc) ⇒ Object
Use standard Vagrant synced folders instead.
423 424 425 |
# File 'lib/vagrant-openstack-provider/config.rb', line 423 def rsync_include(inc) @rsync_includes << inc end |
#validate(machine) ⇒ Object
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/vagrant-openstack-provider/config.rb', line 427 def validate(machine) errors = _detected_errors errors << I18n.t('vagrant_openstack.config.password_required') if @password.nil? || @password.empty? errors << I18n.t('vagrant_openstack.config.username_required') if @username.nil? || @username.empty? errors << I18n.t('vagrant_openstack.config.invalid_api_version') unless %w(2 3).include?(@identity_api_version) validate_api_version(errors) validate_ssh_username(machine, errors) validate_stack_config(errors) validate_ssh_timeout(errors) if machine.config.ssh.insert_key if machine.config.ssh.private_key_path puts I18n.t('vagrant_openstack.config.keypair_name_required').yellow unless @keypair_name || @public_key_path else errors << I18n.t('vagrant_openstack.config.private_key_missing') if @keypair_name || @public_key_path end end { openstack_compute_url: @openstack_compute_url, openstack_network_url: @openstack_network_url, openstack_volume_url: @openstack_volume_url, openstack_orchestration_url: @openstack_orchestration_url, openstack_image_url: @openstack_image_url, openstack_auth_url: @openstack_auth_url }.each_pair do |key, value| errors << I18n.t('vagrant_openstack.config.invalid_uri', key: key, uri: value) unless value.nil? || valid_uri?(value) end { 'Openstack Provider' => errors } end |