Sha256: ee15a04dcff3cb0e8340ea6a802b1e8b23b1c2470def3585ae038a5e24a5be94

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

module Simp; end
module Simp::RspecPuppetFacts
  VERSION = '1.0.1'

  # TODO: roll this into files
  def extra_os_facts
    {
      'CentOS' => {
         '6' => {
         'x86_64' => {
            :grub_version              => '0.97',
            :uid_min                   => '500',
          },
         },
         '7' => {
         'x86_64' => {
            :grub_version              => '2.02~beta2',
            :uid_min                   => '500',
          },
         },
      },
      'RedHat' => {
         '6' => {
         'x86_64' => {
            :grub_version              => '0.97',
            :uid_min                   => '500',
          },
         },
         '7' => {
         'x86_64' => {
            :grub_version              => '2.02~beta2',
            :uid_min                   => '500',
          },
         },
      },
    }
  end

  def on_supported_os( opts = {} )
    h = Simp::RspecPuppetFacts::Shim.on_supported_os( opts )
    h.each do | os, facts |
       facts[:lsbmajdistrelease] = facts[:operatingsystemmajrelease]
       extra_facts               = extra_os_facts.fetch( facts.fetch(:operatingsystem) ).fetch( facts.fetch(:operatingsystemmajrelease) ).fetch( facts.fetch(:architecture) )
       extra_opts_facts          = opts.fetch( :extra_facts, {} )

       facts.merge! extra_facts
       facts.merge! extra_opts_facts
    end

    h
  end

  class Shim
    require 'rspec-puppet-facts'
    extend ::RspecPuppetFacts
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simp-rspec-puppet-facts-1.0.1 lib/simp/rspec-puppet-facts.rb