Sha256: 4a5f5bea7356349570584a4dc98a60b1f6452b8f653983a4dcb029bbd7ffae16

Contents?: true

Size: 682 Bytes

Versions: 17

Compression:

Stored size: 682 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 R10K::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

17 entries across 17 versions & 2 rubygems

Version Path
r10k-5.0.0 lib/r10k/source/yaml.rb
r10k-4.1.0 lib/r10k/source/yaml.rb
r10k-4.0.2 lib/r10k/source/yaml.rb
r10k-4.0.1 lib/r10k/source/yaml.rb
r10k-4.0.0 lib/r10k/source/yaml.rb
r10k-4.0.0.pre lib/r10k/source/yaml.rb
r10k-3.16.0 lib/r10k/source/yaml.rb
r10k-3.15.4 lib/r10k/source/yaml.rb
r10k-3.15.3 lib/r10k/source/yaml.rb
r10k-3.15.2 lib/r10k/source/yaml.rb
r10k-3.15.1 lib/r10k/source/yaml.rb
r10k-3.15.0 lib/r10k/source/yaml.rb
akerl-r10k-3.14.2.1 lib/r10k/source/yaml.rb
r10k-3.14.2 lib/r10k/source/yaml.rb
r10k-3.14.1 lib/r10k/source/yaml.rb
r10k-3.14.0 lib/r10k/source/yaml.rb
r10k-3.13.0 lib/r10k/source/yaml.rb