Module: Puppet::Module::Tool::Utils::Settings
- Included in:
- Puppet::Module::Tool
- Defined in:
- lib/puppet/module/tool/utils/settings.rb
Overview
Settings
This module contains methods for interacting with Puppet’s settings files.
Instance Method Summary collapse
Instance Method Details
#prepare_settings(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/puppet/module/tool/utils/settings.rb', line 8 def prepare_settings( = {}) return if @settings_prepared if [:config] Puppet.settings.send(:set_value, :config, [:config], :cli) end Puppet.setdefaults(:puppet_module, :puppet_module_repository => [Puppet::Module::Tool::REPOSITORY_URL, "The module repository"], :puppet_module_working_dir => ['$vardir/puppet-module', "The directory in which module tool data is stored"]) Puppet::Module::Tool.working_dir.mkpath Puppet.settings.use(:puppet_module) Puppet.settings.parse [:puppet_module_repository].each do |key| if [key] Puppet.settings.send(:set_value, key, [key], :cli) end end @settings_prepared = true end |