Thanks Kevin

I'm kind of aware of plan option.

Can you please detail the option for task with an example so that I can
know how it works.

Cheers
Raghuram Baisani

On Thu, Feb 4, 2021 at 5:12 PM KevinR <[email protected]> wrote:

> Hi Raghuram,
>
> this cannot be (easily) achieved from a Task, as the Task execution
> environment is not Puppet but basically the target's shell.
> You can do this from a Bolt Plan however:
>
>    1. In your Bolt module (where your task lives), create a functions
>    folder at the root
>    2. Place your function in that folder, i.e.f /functions/func1.rb
>    3. Namespace the function according to your module name, for example
>    mymodule::func1
>    4. You can now use the module in a Bolt Plan (under /plans) with
>    mymodule::func1(args)
>
> - KevinR
> On Thursday, February 4, 2021 at 7:53:46 AM UTC+1 [email protected]
> wrote:
>
>> Hi
>>
>> Suppose if we have a module named temp,
>>
>> and we have a puppet function named func1
>> which resides in temp\lib\puppet\functions\temp\func1.rb
>>
>> and I have another ruby task in the same module,
>>
>> temp\tasks\task1.rb
>>
>> How can I call puppet function func1 on task task1?
>>
>> Any kind help is appreciated
>>
>> Cheers
>> Raghuram Baisani
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/c6d2d365-3cc8-4513-b4c3-bb0f062d56d5n%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/c6d2d365-3cc8-4513-b4c3-bb0f062d56d5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAFfXrBxmXFxLMkZUaGr1bOaMbOjLaS4TNwZdzrAQPqpnmvoJDg%40mail.gmail.com.

Reply via email to