Sending an array of files to a host

asked 2014-06-26 10:11:37 -0500

starkb gravatar image

I have about a 50 files that I need to copy to the hosts, so insted of listing a file resource for each one I want to create an array and use the file resource. I have seen many exapmles out on the web, but they don't work. I already have my directory created with a 775 and just want to add the files to it. I'm using the latest version of puppet.

This is an example of what I'm trying to do.

class test{
$file_array = ['test1.ini','test2.ini' etc.]

copyfiles {$file_array:
files_path => $file_array, 
   }
}

define test::copyfiles($files_path){

file {$name:
source => [$files_path],
mode => '0640',
group => 'root',
user => 'root',
sourceselect => 'all',
  }
}
edit retag flag offensive close merge delete