Hi I'm new to puppet and trying to work on a sample to copy files from one location to another location. Any sample script to do that?
Ex: I've my file at d:\temp\test.txt and I want to copy this file to E:\mycopy\ folder.
You can "ensure" that the file at target location exists and provide the file to be copied as source in file type. A partial code snippet only showing relevant parts:
file { 'E:\mycopy\folder\filename':
ensure => present,
source => "d:\temp\test.txt",
}
Check the documentation of file type here and how source attribute behaves here. Now this will work with a few caveats :
But what is your exact purpose? Similar thing can be achieved with content
attribute of file type or other attributes