我正在尝试使用icinga2的puppet模块,该模块定义了custom function和template使用它。我正在使用以下(剥离)hiera配置:
icinga2::object::host:
host.com:
target_file_name: host.conf
display_name: host.com
ipv4_address: XXX
vars:
os: Linux
没有vars
的模板呈现完全正常但是当它被包含时,puppet无法评估模板中的函数调用:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Failed to parse template icinga2/object_host.conf.erb:
Filepath: org/jruby/RubyKernel.java
Line: 1072
Detail: Could not autoload puppet/parser/functions/icinga2_config_value: no such file to load -- puppet/icinga2/utils
at /etc/puppetlabs/code/environments/production/modules/icinga2/manifests/object/host.pp:71:18 on node XXX
当直接在内联模板中调用时,puppet也会发现并执行命令:
root@puppetmaster:~# /opt/puppetlabs/bin/puppet apply -e "notice(inline_template(\"<%= scope.function_icinga2_config_value([[1,2]]) %>\"))"
Notice: Scope(Class[main]): [
"1",
"2",
]
我还发现了一些类似方向的错误(1,2),但它们在多年前修复过,建议的解决方法也不起作用。我正在使用4.2.1的最新版本。
知道如何进一步调试此问题或在icinga2模块中修复它吗?