Puppet Function: kafka_cluster_name
- Defined in:
-
modules/role/lib/puppet/parser/functions/kafka_cluster_name.rb
- Function type:
- Ruby 3.x API
Overview
kafka_cluster_name() ⇒ Any
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'modules/role/lib/puppet/parser/functions/kafka_cluster_name.rb', line 32
newfunction(:kafka_cluster_name, :type => :rvalue, :arity => -2) do |args|
name = call_function('lookup', ['kafka_cluster_name', {'default_value' => :none}])
return name unless name == :none
prefix = args.shift
site = args.shift || lookupvar('::site')
realm = lookupvar('::realm')
if realm == 'labs'
labsp = lookupvar('::wmcs_project')
"#{prefix}-#{labsp}"
else
"#{prefix}-#{site}"
end
end
|