Puppet Class: irqbalance::service

Inherits:
irqbalance
Defined in:
manifests/service.pp

Overview

Class: irqbalance::service

Class to manage the irqbalance service



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'manifests/service.pp', line 5

class irqbalance::service inherits irqbalance {

  # On single processor systems or when oneshot is enabled irqbalance will
  # run and then terminate.
  # For these scenarios ignore service_ensure => 'running' as we don't want
  # Puppet to start irqbalance each Puppet run
  # Note that the irqbalance will still exit immediately on systems with a
  # shared cache and this module does not prevent this.

  if $::processorcount == '1' {
    $singleprocessor = true
  }

  $ignore_service_ensure = $irqbalance::bool_oneshot or $singleprocessor

  $real_service_ensure = $ignore_service_ensure ? {
    true    => undef,
    default => $irqbalance::service_ensure,
  }

  if $irqbalance::service_manage {

    if $ignore_service_ensure {
      notice("${module_name}: Single processor or oneshot parameter detected - service_ensure will be ignored.")
    }

    service { 'irqbalance':
      ensure   => $real_service_ensure,
      enable   => $irqbalance::service_enable,
      name     => $irqbalance::service_name,
      provider => $irqbalance::service_provider,
    }

  }

}