Sha256: 29d0bad7effe119a587adf7cfb9e38fed0ad347370650fe0a67fb681a4884378

Contents?: true

Size: 1.2 KB

Versions: 64

Compression:

Stored size: 1.2 KB

Contents

# The module is named after the author, to ensure that names under PuppetX namespace
# does not clash.
#
require 'puppet_x'
module PuppetX::Helindbe

  # An env data provider that is hardcoded and provides data for
  # the two names 'test::param_a' and 'test::param_b'.
  #
  # A real implementation would read the data from somewhere or invoke some
  # other service to obtain the data. When doing so caching may be performance
  # critical, and it is important that a cache is associated with the apropriate
  # object to not cause memory leaks. See more details in the documentation
  # for how to write a data provider and use adapters.
  #
  class SampleEnvData < Puppet::Plugins::DataProviders::EnvironmentDataProvider
    def initialize()
      @data = { 
        'test::param_a' => 'env data param_a is 10',
        'test::param_b' => 'env data param_b is 20',
        # demo: this overrides a parameter for a class in the dataprovider module
        'backend::test::param_c' => 'env data param_c is 3000',
        'dataprovider::test::param_c' => 'env data param_c is 300',
      }
    end

    def lookup(name, scope, merge)
      throw :no_such_key unless @data.include?(name)
      @data[name]
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
puppet-4.10.12 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.12-x86-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.12-x64-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.12-universal-darwin spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.11 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.11-x86-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.11-x64-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.11-universal-darwin spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.10 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.10-x86-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.10-x64-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.10-universal-darwin spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.9 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.9-x86-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.9-x64-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.9-universal-darwin spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.8 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.8-x86-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.8-x64-mingw32 spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb
puppet-4.10.8-universal-darwin spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb