mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Remove global domain usage from pool manager
This commit is contained in:
parent
268ff9f981
commit
aeabb7e134
2 changed files with 25 additions and 9 deletions
|
|
@ -30,6 +30,26 @@ module Vmpooler
|
|||
plugin_class
|
||||
end
|
||||
|
||||
# Returns the domain for the specified pool
|
||||
#
|
||||
# @param config [String] - the full config structure
|
||||
# @param pool_name [String] - the name of the pool
|
||||
# @return [String] - domain name for pool, which is set via reference to the dns_configs block
|
||||
def self.get_domain_for_pool(config, pool_name)
|
||||
pool = config[:pools].find { |p| p['name'] == pool_name }
|
||||
pool_dns_config = pool['dns_plugin']
|
||||
dns_configs = config[:dns_configs].keys
|
||||
pool_domain = ''
|
||||
|
||||
dns_configs.map do |dns_config_name|
|
||||
if dns_config_name.to_s == pool_dns_config
|
||||
pool_domain = config[:dns_configs][dns_config_name]['domain']
|
||||
end
|
||||
end
|
||||
|
||||
pool_domain
|
||||
end
|
||||
|
||||
# Returns the plugin domain for the specified dns config by name
|
||||
#
|
||||
# @param config [Object] The entire VMPooler config object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue