Sha256: 6efdc4c8174099ca2cf8f5417895c3338adcecb7030336762920463f1b92b2d1

Contents?: true

Size: 394 Bytes

Versions: 27

Compression:

Stored size: 394 Bytes

Contents

require 'puppet'
require 'json'
require 'facter'

ENV.fetch('FACTERLIB').split(':').each{|x| Facter.search x }

Puppet.initialize_settings
Facter.loadfacts

data = Facter.collection.to_hash
facter_major_ver = Facter.version.split('.').first
if ['1','2'].include? facter_major_ver
  facts = data
elsif ['1','2'].include? facter_major_ver
  facts = data['values']
end
jj JSON.parse facts.to_json

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
simp-rspec-puppet-facts-3.13.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.12.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.11.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.10.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.9.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.8.3 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.8.1 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.7.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.6.3 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.6.2 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.6.1 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.6.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.5.1 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.5.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.3.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.2.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.1.1 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.1.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-3.0.0 facts/scripts/get_facts.rb
simp-rspec-puppet-facts-2.4.1 facts/scripts/get_facts.rb