class Facter::ConfigReader
Attributes
conf[RW]
Public Class Methods
block_list()
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 13 def block_list @conf['facts'] && @conf['facts']['blocklist'] end
cli()
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 25 def cli @conf['cli'] end
fact_groups()
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 29 def fact_groups @conf['fact-groups'] end
global()
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 21 def global @conf['global'] end
init(config_path = nil)
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 7 def init(config_path = nil) config_path ||= default_path refresh_config(config_path) self end
refresh_config(config_path)
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 33 def refresh_config(config_path) @conf = File.readable?(config_path) ? Hocon.load(config_path) : {} end
ttls()
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 17 def ttls @conf['facts'] && @conf['facts']['ttls'] end
Private Class Methods
default_path()
click to toggle source
# File lib/facter/framework/config/config_reader.rb, line 39 def default_path 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