You can “guarantee” that a file at the destination location exists and provide a file to be copied as a source in the file type. A partial code snippet showing only the relevant parts:
file { 'E:\mycopy\folder\filename': ensure => present, source => "d:\temp\test.txt", }
Check the file type documentation here and how the source attribute behaves here . This will now work with a few caveats:
- If you use the absolute path to the file as the source, then the file must be present on the agent machine
- If you are submitting a file from the Puppet file server, the source file must be in the appropriate location on the puppet file server.
But what is your goal? This can be achieved using the content attribute of the file type or other attributes.
Vishal biyani
source share