Hi Andy,

you can do this with an Apply block in your plan:

apply_prep($nodes)

apply($nodes, '_run_as' => 'root'){
  file { '/root/my_file.txt':
    ensure  => file,
    content => epp('my_module/my_file.epp', { 'my_param' => 'my_value' })
  }
}

For the above example, you'll need to create a directory called 'my_module' 
in Bolt's modulepath, and then put the .epp file in a templates 
subdirectory.

-Kevin

On Monday, September 16, 2019 at 6:21:05 PM UTC+2, Andy Hall wrote:
>
> hey there just starting using bolt and has a simple plan which applies a 
> manifest but I'd know like to write a dynamic file from a template like epp 
> in puppet. is this possible ? I do not see anything in the docs except just 
> uploading a static file : 
> https://puppet.com/docs/bolt/latest/running_bolt_commands.html#concept-6839
>
> please do let me know if this is possible - it's great being able to write 
> a manifest and templates would be the icing on the cake !
>
> thanks.
>
>

-- 
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/e3049003-192a-4840-b254-7c68090873f8%40googlegroups.com.

Reply via email to