How I must configure a "init.pp" file for sending more than a file in the same class? What I have done is this:
class nagios {
file { ['/usr/lib64/nagios/plugins/']:
path => '/usr/lib64/nagios/plugins/',
ensure => directory,
notify => Service['nrpe'],
source => ["puppet:///modules/mymodule/check_mem.sh",
'puppet:///modules/mymodule/check_mountpoint.sh'],
sourceselect => all,
}
service { 'nrpe':
ensure => 'running',
enable => true,
}
}
What I'm trying is sending two different files to the same remote folder and then restart service.
However, when I run puppet at client, I get these errors:
[...]
Error: Could not set 'file' on ensure: Is a directory - (/usr/lib64/nagios/plugins20170306-28992-j54k6x, /usr/lib64/nagios/plugins) at 153:/etc/puppet/modules/mymodule/manifests/init.pp
[...]
Error: /Stage[main]/Nagios/File[/usr/lib64/nagios/plugins/]/ensure: change from directory to file failed: Could not set 'file' on ensure: Is a directory - (/usr/lib64/nagios/plugins20170306-28992-j54k6x, /usr/lib64/nagios/plugins) at 153:/etc/puppet/modules/mymodule/manifests/init.pp
Where is my mistake?
Thanks.