How to call a function added into lib/puppet/functions ?

asked 2018-02-27 03:44:48 -0500

dsgrangs gravatar image

updated 2018-02-28 11:20:40 -0500

DarylW gravatar image

Hello, (sorry, quite new to puppet !)

Writing a 'simple' puppet module : a new type ('simple/lib/puppet/type/simple.rb') and its provider ('simple/lib/puppet/provider/simple/simpleprovider.rb'), it works as I can use it in one manifest ('simple/manifets/init.pp') :-)

I added now my own function in 'simple/lib/puppet/functions/simple/my_funct.rb, but I cannot succeed in using it from my provider : I tried to call it this way "simple::my_funct()" but I get this error :

 Error: /Stage[main]/Simple/Simple[simple1]: Could not evaluate: undefined local variable or method `simple' for Simple[simple1](provider=simpleprovider):Puppet::Type::Simple::ProviderSimpleprovider.

What would be the canonical way to call a function ? Thank you

edit retag flag offensive close merge delete