Puppet Class: tuned

Defined in:
manifests/init.pp

Overview

Manages the activation of tuned

The following options only affect ‘tuned’

Parameters:

  • use_sysctl (Boolean) (defaults to: true)

    This is the custom sysctl configuration file. Set to false to use only the ktune settings.

  • use_sysctl_post (Boolean) (defaults to: false)

    This is the ktune sysctl file. Any settings in this file will be applied after custom settings, overriding them. Comment this out to not use ktune settings.

  • io_scheduler (Tuned::IoSchedule) (defaults to: 'deadline')

    This is the I/O scheduler ktune will use. This will not override anything explicitly set on the kernel command line, nor will it change the scheduler for any block device that is using a non-default scheduler when ktune starts. You should probably leave this on “deadline”, but “as”, “cfq”, and “noop” are also legal values.

  • elevator_tune_devs (Array[String]) (defaults to: ['hd','sd','cciss'])

    These are the devices, that should be tuned with the ELEVATOR

  • tuning_interval (Integer) (defaults to: 10)

    The number of seconds between tuning runs.

  • diskmonitor_enable (Boolean) (defaults to: true)

    Enable the disk monitoring plugin.

  • disktuning_enable (Boolean) (defaults to: true)

    Enable the disk tuning plugin.

  • disktuning_hdparm (Boolean) (defaults to: true)

    Use ‘hdparm’ for disk tuning.

  • disktuning_alpm (Boolean) (defaults to: true)

    Use ‘ALPM’ when disk tuning.

  • netmonitor_enable (Boolean) (defaults to: true)

    Enable the network monitoring plugin.

  • nettuning_enable (Boolean) (defaults to: true)

    Enable the network tuning plugin.

  • cpumonitor_enable (Boolean) (defaults to: true)

    Enable the CPU monitoring plugin.

  • cputuning_enable (Boolean) (defaults to: true)

    Enable the CPU tuning plugin.

  • package_ensure (String) (defaults to: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }))

    The ensure status of the tuned package



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/init.pp', line 40

class tuned (
  Tuned::IoSchedule $io_scheduler       = 'deadline',
  Array[String]     $elevator_tune_devs = ['hd','sd','cciss'],
  Boolean           $use_sysctl         = true,
  Boolean           $use_sysctl_post    = false,
  Integer           $tuning_interval    = 10,
  Boolean           $diskmonitor_enable = true,
  Boolean           $disktuning_enable  = true,
  Boolean           $disktuning_hdparm  = true,
  Boolean           $disktuning_alpm    = true,
  Boolean           $netmonitor_enable  = true,
  Boolean           $nettuning_enable   = true,
  Boolean           $cpumonitor_enable  = true,
  Boolean           $cputuning_enable   = true,
  String            $package_ensure     = simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }),
) {

  $ktune_name = 'tuned'

  file { '/etc/tuned.conf':
    owner   => 'root',
    group   => 'root',
    mode    => '0640',
    content => template('tuned/etc/tuned.conf.erb'),
    notify  => Service[$ktune_name]
  }

  file { '/etc/sysconfig/ktune':
    owner   => 'root',
    group   => 'root',
    mode    => '0640',
    content => template('tuned/etc/sysconfig/ktune.erb')
  }

  file { '/etc/sysctl.ktune':
    ensure => 'present',
    owner  => 'root',
    group  => 'root',
    mode   => '0640'
  }

  package { $ktune_name:
    ensure => $package_ensure
  }

  service { $ktune_name:
    ensure     => 'running',
    enable     => true,
    hasrestart => true,
    hasstatus  => true,
    require    => [
      Package[$ktune_name],
      File['/etc/sysconfig/ktune']
    ]
  }
}