class Facter::ConfigReader
Attributes
Public Class Methods
Source
# File lib/facter/framework/config/config_reader.rb, line 14 def block_list @conf['facts'] && @conf['facts']['blocklist'] end
Source
# File lib/facter/framework/config/config_reader.rb, line 41 def clear @conf = {} end
Source
# File lib/facter/framework/config/config_reader.rb, line 30 def fact_groups @conf['fact-groups'] end
Source
# File lib/facter/framework/config/config_reader.rb, line 22 def global @conf['global'] end
Source
# File lib/facter/framework/config/config_reader.rb, line 8 def init(config_path = nil) config_path ||= default_path refresh_config(config_path) self end
Source
# File lib/facter/framework/config/config_reader.rb, line 34 def refresh_config(config_path) @conf = File.readable?(config_path) ? Hocon.load(config_path) : {} rescue StandardError => e log.warn("Facter failed to read config file #{config_path} with the following error: #{e.message}") @conf = {} end
Source
# File lib/facter/framework/config/config_reader.rb, line 18 def ttls @conf['facts'] && @conf['facts']['ttls'] end
Private Class Methods
Source
# File lib/facter/framework/config/config_reader.rb, line 51 def default_path return '' if RUBY_PLATFORM == 'java' os = OsDetector.instance.identifier windows_path = File.join('C:', 'ProgramData', 'PuppetLabs', 'facter', 'etc', 'facter.conf') linux_path = File.join('/', 'etc', 'puppetlabs', 'facter', 'facter.conf') os == :windows ? windows_path : linux_path end
Source
# File lib/facter/framework/config/config_reader.rb, line 47 def log @log ||= Log.new(self) end