The sourceselect
parameter only affects recursive directory copies. For single files, you need multiple file
resources, as in that case, only the first file will be copied.
Alternately, when serving directories recursively, multiple sources can be combined by setting the sourceselect attribute to all.
(Source)
Your second problem is that you tell Puppet to ensure that the target is a directory. In that case, giving a source file doesn't make any sense - you can't save a file as a directory. You would need to set it to file
or present
.
Re your comment: Something like this should work:
file { ['/usr/lib64/nagios/plugins/check_mem.sh']:
ensure => "file",
notify => Service['nrpe'],
source => "puppet:///modules/mymodule/check_mem.sh",
}
file { ['/usr/lib64/nagios/plugins/check_mountpoint.sh']:
ensure => "file",
notify => Service['nrpe'],
source => "puppet:///modules/mymodule/check_mountpoint.sh",
}