Puppet Function: prop_supported

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

Overview

prop_supported()Any

Returns:

  • (Any)


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/puppet/parser/functions/prop_supported.rb', line 26

newfunction(:prop_supported, type: :rvalue) do |args|
  # Use catch-all arrays for common properties
  evpn = [:route_target_both_auto_evpn,
          :route_target_import_evpn,
          :route_target_export_evpn,
         ]
  mvpn = [:route_target_both_auto_mvpn,
          :route_target_import_mvpn,
          :route_target_export_mvpn,
         ]
  rt = [:route_target_both_auto,
        :route_target_import,
        :route_target_export,
       ]

  plat = function_platform_get([])
  case args[0].to_sym
  when *evpn,
       *rt,
       :route_distinguisher
    return true if plat[/n7k/] && function_find_linecard(['N7K-F3'])
    return true if plat[/n9k/]
  when *mvpn
    return true if plat[/n9k(-ex)?$/]
  end
  false
end