Puppet Function: requires_realm

Defined in:
puppet/modules/wmflib/lib/puppet/parser/functions/requires_realm.rb
Function type:
Ruby 3.x API

Overview

requires_realm()Any

Returns:

  • (Any)


12
13
14
15
16
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/requires_realm.rb', line 12

newfunction(:requires_realm, :arity => 1) do |args|
  realm, message = args
  fail(ArgumentError, 'requires_realm(): string argument required') unless realm.is_a?(String)
  fail(Puppet::ParseError, message || "Realm '#{realm}' required.") unless realm == lookupvar('realm')
end