Puppet Class: tuned::config

Defined in:
manifests/config.pp

Overview

Parameters:

  • profile (Any)
  • dynamic_tuning (Any)
  • sleep_interval (Any)
  • update_interval (Any)
  • main_conf (Any)
  • profiles_path (Any)
  • active_profile_conf (Any)


1
2
3
4
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
41
42
43
44
45
46
47
48
49
50
51
# File 'manifests/config.pp', line 1

class tuned::config (
  $profile,
  $dynamic_tuning,
  $sleep_interval,
  $update_interval,
  $main_conf,
  $profiles_path,
  $active_profile_conf,
) {
  $_active_profile_fn = "${profiles_path}/${active_profile_conf}"
  validate_absolute_path($_active_profile_fn)

  # if no profile specified, tuned will detect suitable
  if ! empty($profile) {
    exec { 'tuned-adm_profile':
      command => shellquote('tuned-adm', 'profile', $profile),
      unless  => shellquote('grep', '-Fqx', $profile, $_active_profile_fn),
      path    => '/bin:/usr/bin:/sbin:/usr/sbin',
    }
  }

  if ! empty($main_conf) {
    Ini_setting {
      path    => $main_conf,
      section => '',
      notify  => Class['tuned::service'],
    }

    if ! empty($profile) {
      Ini_setting {
        before => Exec['tuned-adm_profile'],
      }
    }

    $_dynamic_tuning = bool2num($dynamic_tuning)
    ini_setting { 'tuned-dynamic_tuning':
      setting => 'dynamic_tuning',
      value   => $_dynamic_tuning,
    }

    ini_setting { 'tuned-sleep_interval':
      setting => 'sleep_interval',
      value   => $sleep_interval,
    }

    ini_setting { 'tuned-update_interval':
      setting => 'update_interval',
      value   => $update_interval,
    }
  }
}