jhoblitt / puppet-smartd

Manages the smartmontools package including the smartd daemon
Other
14 stars 24 forks source link

Invalid relationship: File[/etc/smartd.conf] when ensure is changed from present to (absent|purged) #46

Closed samuraiii closed 8 years ago

samuraiii commented 8 years ago

Hello, I am getting following error : Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: File[/etc/smartd.conf] { notify => Service[smartd] }, because Service[smartd] doesn't seem to be in the catalog Warning: Not using cache on failed catalog

When class{'smartd': ensure => 'present'; } is changed to ensure absent or purged. Module version is 2.5.1 puppet is 3.8.4

jhoblitt commented 8 years ago

@samuraiii Bummer -- this module could use some acceptance tests. This metaparam is the likely culprit: https://github.com/jhoblitt/puppet-smartd/blob/0d434ce7daa32beb927b3d29c00b9bca4d464265/manifests/init.pp#L178 . Are you willing to take a stab at fixing it?

samuraiii commented 8 years ago

I would suggest to drop notify => Service[$service_name], and to subscribe service to that file subscribe => File[$config_file],

https://github.com/jhoblitt/puppet-smartd/pull/50 Should work, but I have not tested it yet.

samuraiii commented 8 years ago

I can confirm that this way it works...

jhoblitt commented 8 years ago

This should be resolved by #53.