Class: Puppet::Pops::Binder::SystemBindings

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/pops/binder/system_bindings.rb

Constant Summary collapse

ENVIRONMENT_BOOT_BINDINGS_NAME =

Constant with name used for bindings used during initialization of injector

'puppet::env::injector::boot'
Factory =
Puppet::Pops::Binder::BindingsFactory

Class Method Summary collapse

Class Method Details

.default_bindingsObject



15
16
17
# File 'lib/puppet/pops/binder/system_bindings.rb', line 15

def self.default_bindings()
  @default_bindings
end

.default_contributionObject



32
33
34
35
# File 'lib/puppet/pops/binder/system_bindings.rb', line 32

def self.default_contribution
  effective_categories = Factory.categories([['common', 'true']])
  Factory.contributed_bindings("puppet-default", [deep_clone(@default_bindings.model)], effective_categories)
end

.extensionsObject



11
12
13
# File 'lib/puppet/pops/binder/system_bindings.rb', line 11

def self.extensions()
  @extension_bindings
end

.factoryObject



59
60
61
# File 'lib/puppet/pops/binder/system_bindings.rb', line 59

def self.factory()
  Puppet::Pops::Binder::BindingsFactory
end

.final_contributionObject

def self.env_boot_bindings()

  Puppet::Bindings[Puppet::Pops::Binder::SystemBindings::ENVIRONMENT_BOOT_BINDINGS_NAME]
end


27
28
29
30
# File 'lib/puppet/pops/binder/system_bindings.rb', line 27

def self.final_contribution
  effective_categories = Factory.categories([['common', 'true']])
  Factory.contributed_bindings("puppet-final", [deep_clone(@extension_bindings.model)], effective_categories)
end

.injector_boot_bindingsObject



19
20
21
# File 'lib/puppet/pops/binder/system_bindings.rb', line 19

def self.injector_boot_bindings()
  @injector_boot_bindings
end

.injector_boot_contribution(env_boot_bindings) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/puppet/pops/binder/system_bindings.rb', line 37

def self.injector_boot_contribution(env_boot_bindings)
  # Compose the injector_boot_bindings contributed from the puppet runtime book (i.e. defaults for
  # extensions that should be active in the boot injector - see Puppetx initialization.
  #
  bindings = [deep_clone(@injector_boot_bindings.model), deep_clone(@injector_default_bindings)]

  # Add the bindings that come from the bindings_composer as it may define custom extensions added in the bindings
  # configuration. (i.e. bindings required to be able to lookup using bindings schemes and backends when
  # configuring the real injector).
  #
  bindings << env_boot_bindings unless env_boot_bindings.nil?

  # Use an 'extension' category for extension bindings to allow them to override the default
  # bindings since they are placed in the same layer (this is done to avoid having a separate layer).
  # The purpose for allowing overrides is that someone may want to replace say 'yaml' with a different version,
  # (say one that uses a YAML implementation that actually works ok in ruby 1.8.7 ;-)), an encrypted parser, etc.
  effective_categories = Factory.categories([['extension', 'true'],['common', 'true']])

  # return the composition and the cateogires.
  Factory.contributed_bindings("puppet-injector-boot", bindings, effective_categories)
end

.type_factoryObject



63
64
65
# File 'lib/puppet/pops/binder/system_bindings.rb', line 63

def self.type_factory()
  Puppet::Pops::Types::TypeFactory
end