Puppet – 自定义函数 – 语句 – 错误 – “必须是语句的值…”

看起来很简单…

# /path/to/puppet/modules/custom/lib/puppet/parser/functions module Puppet::Parser::Functions newfunction(:release_check) do |args| raise(Puppet::ParseError, "Testing!") end end # /path/to/puppet/modules/mysql/manifests/install.pp class mysql::install { # Doesn't work release_check(1) # Does work, but I don't want anything returned making the assignment superfluous $whocares = release_check(1) } 

但是我一直得到这个错误:

 err: Could not retrieve catalog from remote server: Error 400 on SERVER: Function 'release_check' must be the value of a statement at /etc/puppet/modules/mysql/manifests/install.pp:4 on node service-a-3 

但根据傀儡的文件 ,我应该可以把这个电话写下来。

这个简单的write_line_to_file函数是一个语句函数的例子。 它执行一个动作,并不返回一个值。

我错过了什么?

CentOS:6.7 Puppetmaster:2.7.26

经过一些facepalming,似乎你必须重新启动傀儡大师之后,你做了一个自定义函数,即使每次更改后发送到代理,更改。

误导 ,至less可以说。