Ask Your Question
0

Strugging getting custom function to work. version v3.6.2

asked 2016-10-12 07:50:09 -0500

Kevin T gravatar image

updated 2016-11-09 22:53:57 -0500

ramindk gravatar image

Have added a sbfexists.fb file in: /etc/puppet/modules/rootdir/lib/puppet/parser/functions/newfunction/sbfexists.rb

(head of this is)

module Puppet::Parser::Functions
  newfunction(:sbfexists, :type => :rvalue, :doc => .....
Returns an boolean value if a given file and/or directory exists on Puppet Master.

Prototype:....


On starting the Master and doing a client apply i get on the client.

Info: Retrieving pluginfacts
Info: Retrieving plugin
Notice: /File[/var/lib/puppet/lib/puppet/parser/functions/newfunction/sbfexists.rb]/ensure: defined content as '{md5}2501c6d98eee6708c09418a91db65b00'
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Unknown function: 'sbfexists'. at /etc/puppet/modules/rootdir/manifests/init.pp:13:12 on node oc5228263825.ibm.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Im just testing the outcome of the sbfexists function so in my init.pp it just has this single call to sbfexists

define hashDebug($user, $group, $mode) {
  notify { "Item ${name} has value ${user}, group ${group} and mode ${mode}": }

    $a = "puppet:///modules/rootdir/${name}:${::fqdn}"
    $b = "puppet:///modules/rootdir/${name}"

    notice sbfexists($a)
.........

What have i missed :O(
Why is puppet complaining my function is unknown

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-10-12 12:46:33 -0500

lupin gravatar image

The path would be

/etc/puppet/modules/rootdir/lib/puppet/parser/functions/sbfexists.rb

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-12 07:50:09 -0500

Seen: 57 times

Last updated: Oct 12 '16