Sha256: 7b8c0b1360d6085d5ad3c33a71e618b41eed004440b11ad2933e27d1a3246c58

Contents?: true

Size: 676 Bytes

Versions: 16

Compression:

Stored size: 676 Bytes

Contents

class R10K::Source::Yaml < R10K::Source::Hash
  R10K::Source.register(:yaml, self)

  def initialize(name, basedir, options = {})
    config = options[:config] || '/etc/puppetlabs/r10k/environments.yaml'

    begin
      contents = ::YAML.load_file(config)
    rescue => e
      raise ConfigError, _("Couldn't open environments file %{file}: %{err}") % {file: config, err: e.message}
    end

    # Set the environments key for the parent class to consume
    options[:environments] = contents

    # All we need to do is supply options with the :environments hash.
    # The R10K::Source::Hash parent class takes care of the rest.
    super(name, basedir, options)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
r10k-3.12.1 lib/r10k/source/yaml.rb
r10k-3.12.0 lib/r10k/source/yaml.rb
r10k-3.11.0 lib/r10k/source/yaml.rb
r10k-3.10.0 lib/r10k/source/yaml.rb
r10k-3.9.3 lib/r10k/source/yaml.rb
r10k-3.9.2 lib/r10k/source/yaml.rb
r10k-3.9.1 lib/r10k/source/yaml.rb
r10k-3.9.0 lib/r10k/source/yaml.rb
r10k-3.8.0 lib/r10k/source/yaml.rb
r10k-3.7.0 lib/r10k/source/yaml.rb
r10k-3.6.0 lib/r10k/source/yaml.rb
r10k-3.5.2 lib/r10k/source/yaml.rb
r10k-3.5.1 lib/r10k/source/yaml.rb
r10k-3.5.0 lib/r10k/source/yaml.rb
r10k-3.4.1 lib/r10k/source/yaml.rb
r10k-3.4.0 lib/r10k/source/yaml.rb