diff --git a/docs/configuration.md b/docs/configuration.md index 0bf331f..1c34c72 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -21,10 +21,7 @@ Path to a the file to use when loading the vmpooler configuration. This is only ### DOMAIN -If set, returns a top-level 'domain' JSON key in POST requests. Note that domains can now be set per-pool -and at the provider level. The domain key in the JSON response will correspond the last vm added to the -response and should not be relied upon as the hostnames of the returned vms now include the domain. The -domain key is only retained now for backwards compatibility and will be removed in the future. +This environment variable is to set the configuration config.domain (optional) ### REDIS\_SERVER diff --git a/lib/vmpooler/pool_manager.rb b/lib/vmpooler/pool_manager.rb index 993a4b9..9ed2982 100644 --- a/lib/vmpooler/pool_manager.rb +++ b/lib/vmpooler/pool_manager.rb @@ -371,7 +371,7 @@ module Vmpooler # skip dns check if the provider is set to skip_dns_check_before_creating_vm provider = get_provider_for_pool(pool_name) - if config[:providers] && config[:providers][provider.name.to_sym] && config[:providers][provider.name.to_sym]['skip_dns_check_before_creating_vm'] + if provider && provider.provider_config['skip_dns_check_before_creating_vm'] dns_available = true else dns_ip, dns_available = check_dns_available(fqdn) diff --git a/spec/integration/api/v1/vm_template_spec.rb b/spec/integration/api/v1/vm_template_spec.rb index 25c0fbd..83097e8 100644 --- a/spec/integration/api/v1/vm_template_spec.rb +++ b/spec/integration/api/v1/vm_template_spec.rb @@ -24,6 +24,7 @@ describe Vmpooler::API::V1 do 'site_name' => 'test pooler', 'vm_lifetime_auth' => 2, }, + providers: { vsphere: {} }, pools: [ {'name' => 'pool1', 'size' => 5}, {'name' => 'pool2', 'size' => 10}, diff --git a/spec/integration/api/v2/vm_template_spec.rb b/spec/integration/api/v2/vm_template_spec.rb index dc46c40..1a487a4 100644 --- a/spec/integration/api/v2/vm_template_spec.rb +++ b/spec/integration/api/v2/vm_template_spec.rb @@ -24,6 +24,7 @@ describe Vmpooler::API::V2 do 'site_name' => 'test pooler', 'vm_lifetime_auth' => 2, }, + providers: { vsphere: {} }, pools: [ {'name' => 'pool1', 'size' => 5}, {'name' => 'pool2', 'size' => 10}, diff --git a/vmpooler.yaml.example b/vmpooler.yaml.example index 1d8591e..a381bf9 100644 --- a/vmpooler.yaml.example +++ b/vmpooler.yaml.example @@ -28,6 +28,12 @@ # Expects an array of strings specifying the allowed items by name # (optional; default: nil) # +# - skip_dns_check_before_creating_vm +# Setting this configuration parameter in a provider will make vmpooler skip the check it normally does for a DNS +# record. The normal behavior is to check DNS and if a record already exists (conflict) to re-generate a new hostname. +# By using this configuration parameter, it will skip the check and continue with the same conflicting name. This is +# useful for providers that can handle that case, for instance by replacing the existing DNS record with a new one. +# # If you want to support more than one provider with different parameters (server, username or passwords) you have to specify the # backing service in the provider_class configuration parameter for example 'vsphere' or 'dummy'. Each pool can specify # the provider to use. @@ -440,10 +446,10 @@ # If set, restricts tags to those specified in this array. # # - domain -# If set, returns a top-level 'domain' JSON key in POST requests. Note that domains can now be set per-pool -# and at the provider level. The domain key in the JSON response will correspond the last vm added to the -# response and should not be relied upon as the hostnames of the returned vms now include the domain. The -# domain key is only retained now for backwards compatibility and will be removed in the future. +# If set, returns a top-level 'domain' JSON key in POST requests (v1). +# in the v2 API, it concatenates the hostname to include the domain, either set here or at the provider level +# With the introduction of vmpooler-provider-gce, domains can now be set at the provider level. The +# domain key is only retained in v1 for backwards compatibility and will be removed in the future. # # - prefix # If set, prefixes all created VMs with this string. This should include