충분히 간단해 보이는데...
# /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 퍼핏마스터: 2.7.26
답변1
약간의 얼굴 표정 후에는 사용자 정의 기능을 변경할 때마다 puppetmaster를 다시 시작해야 하는 것 같습니다. 비록 모든 변경 후에는 변경 사항이 에이전트로 전송됩니다.
오해의 소지가 있는최소한으로 말하면.