Puppet模板找不到模块函数
我试图使用icinga2的puppet模块,它定义了一个和一个使用它的位置。我正在使用以下(剥离)hiera配置:Puppet模板找不到模块函数,puppet,icinga,Puppet,Icinga,我试图使用icinga2的puppet模块,它定义了一个和一个使用它的位置。我正在使用以下(剥离)hiera配置: icinga2::object::host: host.com: target_file_name: host.conf display_name: host.com ipv4_address: XXX vars: os: Linux 不带vars的模板呈现完全良好,但当包含它时,puppet无法评估模板中的函数调用: Error:
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
root@puppetmaster:~# /opt/puppetlabs/bin/puppet apply -e "notice(inline_template(\"<%= scope.function_icinga2_config_value([[1,2]]) %>\"))"
Notice: Scope(Class[main]): [
"1",
"2",
]
此外,当在内联模板中直接调用时,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
root@puppetmaster:~# /opt/puppetlabs/bin/puppet apply -e "notice(inline_template(\"<%= scope.function_icinga2_config_value([[1,2]]) %>\"))"
Notice: Scope(Class[main]): [
"1",
"2",
]
root@puppetmaster:~\/opt/puppetlabs/bin/puppet apply-e“通知(内联模板(\“\”))
注意:范围(类别[main]):[
"1",
"2",
]
我还发现了一些类似的bug(,),但它们在几年前已经修复,建议的解决方法也不起作用。我使用的是4.2.1的最新版本
知道如何进一步调试此问题或在icinga2模块中修复它吗?根错误似乎是加载
puppet/icinga2/utils.rb失败。你能找到你主人的档案吗?是的,谢谢你给我指出了正确的方向!require语句失败,因为puppet无法找到文件(但只是在代理运行时)。似乎其他人也有类似的问题,但作为一个ruby&puppet noob,我无法判断他们是否真的正确或是最好的方法。尽管如此,我还是用我的修复程序创建了一个。根错误似乎是加载puppet/icinga2/utils.rb
失败。你能找到你主人的档案吗?是的,谢谢你给我指出了正确的方向!require语句失败,因为puppet无法找到文件(但只是在代理运行时)。似乎其他人也有类似的问题,但作为一个ruby&puppet noob,我无法判断他们是否真的正确或是最好的方法。尽管如此,我还是用我的补丁创建了一个。