Copy multiple template files to target location on the puppet agent

asked 2016-10-07 06:37:14 -0600

I have a requirement wherein there are multiple template files that needs to be copied to the same target path on the puppet agent machine, and the target path is determined by facts. Is there a way to accomplish this using only one instance of 'file' resource?. I tried googling but couldn't get any help.

edit retag flag offensive close merge delete


perhaps you can add an mock sample of what you're trying to achieve.

lupin gravatar imagelupin ( 2016-10-07 14:26:15 -0600 )edit

There are around 5 template files which have to be copied to the puppet agent machine. And if there is a change in any of the template files, server restart script has to be notified.

iowasandroid gravatar imageiowasandroid ( 2016-10-12 03:10:09 -0600 )edit

So the way i thought of it was having a single file resource copy all the templates,rather than having separate file resource declarations like below file {"copy_templates": path: "${::target_path}", content: template('<module_name>/file1.xml.erb'), content: template('<module_name>/file2.xml.erb'),

iowasandroid gravatar imageiowasandroid ( 2016-10-12 03:12:32 -0600 )edit