Sha256: 9ccf7622adac4bba02b87f5d9e5c6d9d47bdecfcf5e3f9c307518ef32c2741df

Contents?: true

Size: 974 Bytes

Versions: 22

Compression:

Stored size: 974 Bytes

Contents

begin
  require 'corl'

  # Load network if it exists
  network_path   = Facter.value("corl_network")
  network_config = CORL.config(:network, { :directory => network_path })
    
  if CORL.admin? || network_path != network_config[:directory]
    network = CORL.network(network_config[:directory], network_config, :default)
    
    if network && node = network.local_node
      Facter.add(:corl_provider) do
        setcode do
          node.plugin_provider.to_s
        end  
      end
      
      corl_facts = CORL::Util::Data.merge([ {
        :corl_identity    => "test",
        :corl_stage       => "initialize",
        :corl_type        => "unknown",
        :corl_environment => "development"
      }, node.custom_facts ])
      
      CORL::Util::Data.hash(corl_facts).each do |name, value|    
        Facter.add(name) do
          setcode do
            value
          end
        end
      end
    end
  end
rescue # Prevent abortions if does not exist
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
corl-0.5.18 lib/facter/custom_facts.rb
corl-0.5.17 lib/facter/custom_facts.rb
corl-0.5.16 lib/facter/custom_facts.rb
corl-0.5.15 lib/facter/custom_facts.rb
corl-0.5.14 lib/facter/custom_facts.rb
corl-0.5.13 lib/facter/custom_facts.rb
corl-0.5.12 lib/facter/custom_facts.rb
corl-0.5.11 lib/facter/custom_facts.rb
corl-0.5.10 lib/facter/custom_facts.rb
corl-0.5.9 lib/facter/custom_facts.rb
corl-0.5.8 lib/facter/custom_facts.rb
corl-0.5.7 lib/facter/custom_facts.rb
corl-0.5.6 lib/facter/custom_facts.rb
corl-0.5.5 lib/facter/custom_facts.rb
corl-0.5.4 lib/facter/custom_facts.rb
corl-0.5.3 lib/facter/custom_facts.rb
corl-0.5.2 lib/facter/custom_facts.rb
corl-0.5.1 lib/facter/custom_facts.rb
corl-0.5.0 lib/facter/custom_facts.rb
corl-0.4.29 lib/facter/custom_facts.rb