Seems simple enough...
# /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)
}
But I keep getting this error:
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
But according to the puppet docs, I should be able to make that call as written.
This simple write_line_to_file function is an example of a statement function. It performs an action, and does not return a value.
What am I missing?
CentOS: 6.7 Puppetmaster: 2.7.26