Sha256: dbfca094f0211fd6b531138aae680c50158989110fb584dc88c997c6c24cc17c

Contents?: true

Size: 518 Bytes

Versions: 70

Compression:

Stored size: 518 Bytes

Contents

# frozen_string_literal: true

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

  def env(name)
    # Send analytics report
    Puppet.lookup(:bolt_executor) {}&.report_function_call(self.class.name)

    ENV[name]
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
bolt-3.29.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.28.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.27.4 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.27.2 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.27.1 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.26.2 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.26.1 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.25.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.24.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.23.1 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.23.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.22.1 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.22.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.21.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.20.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.19.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.18.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.17.0 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.16.1 bolt-modules/system/lib/puppet/functions/system/env.rb
bolt-3.16.0 bolt-modules/system/lib/puppet/functions/system/env.rb