mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
(POOLER-157) Add extra_config option to vmpooler
This commit adds the extra_config option to vmpooler to allow specifying additional configuration files to load from. Without this change vmpooler does not offer a mechanism to provide additional configuration files for the application.
This commit is contained in:
parent
dfa2f8620a
commit
8bb89b604d
5 changed files with 27 additions and 5 deletions
|
|
@ -27,6 +27,14 @@ module Vmpooler
|
|||
# Take the name of the config file either from an ENV variable or from the filepath argument
|
||||
config_file = ENV['VMPOOLER_CONFIG_FILE'] || filepath
|
||||
parsed_config = YAML.load_file(config_file) if File.exist? config_file
|
||||
parsed_config[:config]['extra_config'] = ENV['EXTRA_CONFIG'] if ENV['EXTRA_CONFIG']
|
||||
if parsed_config[:config]['extra_config']
|
||||
extra_configs = parsed_config[:config]['extra_config'].split(',')
|
||||
extra_configs.each do |config|
|
||||
extra_config = YAML.load_file(config)
|
||||
parsed_config.merge!(extra_config)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
parsed_config ||= { config: {} }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue