service.pp 692 B

1234567891011121314151617181920
  1. # Class: icinga2::nrpe::service
  2. #
  3. # This class manges the daemons/services for the server components of Icinga.
  4. #
  5. # Parameters:
  6. class icinga2::nrpe::service inherits icinga2::nrpe {
  7. include icinga2::nrpe
  8. #Service resource for NRPE.
  9. #This references the daemon name we defined in the icinga2::params class based on the OS:
  10. service {$icinga2::params::nrpe_daemon_name:
  11. ensure => running,
  12. enable => true, #Enable the service to start on system boot
  13. require => Package[$icinga2::params::icinga2_client_packages],
  14. subscribe => Class['icinga2::nrpe::config'], #Subscribe to the client::config class so the service gets restarted if any config files change
  15. }
  16. }