Nerdier

Adjective: Comparative form of nerdy: more nerdy.

Puppet: Failed to apply catalog: Could not find dependent Service[nrpe] for file.

During my puppeting today I encounted the following error when trying to apply a manifest;

Failed to apply catalog: Could not find dependent Service[nrpe] for File[/etc/nagios/nrpe.cfg]

My manifest looked like;

file { "/etc/nagios/nrpe.cfg":
    ensure => "present",
    source => "puppet:///modules/internal-module/cpanel-shared/nrpe.cfg",
    notify => Service['nrpe'],
}

It turns out you need to also define the service in the manifest to use the notify service function, so I added the following to the manifest;

service { "nrpe":
    ensure  => "running",
    enable  => "true",
}

file { "/etc/nagios/nrpe.cfg":
    ensure => "present",
    source => "puppet:///modules/internal-module/cpanel-shared/nrpe.cfg",
    notify => Service['nrpe'],
}

And it will now restart the service when the file is changed (and not break the manifest..) ! :)

Leave a Reply

Your email address will not be published. Required fields are marked *