What I want to do is quite simple :
1.
Copy /source/file to /target/file. I achieve this using the following:
file { 'my_file_copy':
ensure => file,
source => 'file:/source/file',
path => "/target/file",
}
2.
However, if file /source/file does not exist, I do NOT want it to perform this task.
I am really struggling with this logic. I attempted the solution below but it throws exceptions during puppet run.
puppet: if one file exists then copy another file over
Is there a better way of achieving this task ? Ideally, I would like to only use "file" and avoid using "exec". But at this point I would settle for a solution !