Module: PuppetRepl::Support::Facts

Included in:
PuppetRepl::Support
Defined in:
lib/puppet-repl/support/facts.rb

Instance Method Summary collapse

Instance Method Details

#facterdb_filterObject

in the future we will want to grab real facts from real systems via puppetdb or enc data



6
7
8
# File 'lib/puppet-repl/support/facts.rb', line 6

def facterdb_filter
  'operatingsystem=RedHat and operatingsystemrelease=/^7/ and architecture=x86_64 and facterversion=/^2.4\./'
end

#factsObject

uses facterdb (cached facts) and retrives the facts given a filter



11
12
13
14
15
16
# File 'lib/puppet-repl/support/facts.rb', line 11

def facts
  unless @facts
    @facts ||= FacterDB.get_facts(facterdb_filter).first
  end
  @facts
end