I have a requirement where I need to check for a file on the puppet master and copy it to the agent only if it is not empty.
I have the following so far:
exec {
'check_empty_file':
provider => shell,
command => "test -s puppet:////path/to/puppetmaster/file",
returns => ["0", "1"],
}
if $check_empty_file == '0' {
file {
'file_name':
path => '/path/to/agent/file',
alias => '/path/to/agent/file',
source => "puppet:///path/to/puppetmaster/file",
}
}
But it doesn't work. Any help is appreciated. Thanks!