Sha256: 9e468be20df21c199d2b97f287d48c7b5e3199e934d23c69be8134f09ca112d2

Contents?: true

Size: 443 Bytes

Versions: 11

Compression:

Stored size: 443 Bytes

Contents

# frozen_string_literal: true

# Get an environment variable.
Puppet::Functions.create_function(:'system::env') do
  # @param name Environment variable name.
  # @example Get the USER environment variable
  #   system::env('USER')
  dispatch :env do
    required_param 'String', :name
    return_type 'Optional[String]'
  end

  def env(name)
    Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)
    ENV[name]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bolt-1.49.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.48.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.47.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.45.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.44.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.43.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.42.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.41.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.40.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.39.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-1.38.0 bolt-modules/system/lib/puppet/functions/system/env.rb