Puppet Class: kmod

Defined in:
manifests/init.pp

Summary

Ensures a couple of mandatory files are present before managing their content.

Overview

Examples:

include kmod

Parameters:

  • list_of_aliases (Hash) (defaults to: {})

    Hash of [‘kmod::alias`](#kmodalias) resources

  • list_of_blacklists (Hash) (defaults to: {})

    Hash of [‘kmod::blacklist`](#kmodblacklist) resources

  • list_of_installs (Hash) (defaults to: {})

    Hash of [‘kmod::install`](#kmodinstall) resources

  • list_of_loads (Hash) (defaults to: {})

    Hash of [‘kmod::load`](#kmodload) resources

  • list_of_options (Hash) (defaults to: {})

    Hash of [‘kmod::option`](#kmodoption) resources

  • owner (String[1]) (defaults to: 'root')

    Default owner for all files (set via Hiera to allow defaults on all defined types)

  • group (String[1]) (defaults to: 'root')

    Default group for all files (set via Hiera to allow defaults on all defined types)

  • directory_mode (Stdlib::Filemode) (defaults to: '0755')

    Default mode for all directories (set via Hiera to allow defaults on all defined types)

  • file_mode (Stdlib::Filemode) (defaults to: '0644')

    Default mode for all regular files (set via Hiera to allow defaults on all defined types)

  • exe_mode (Stdlib::Filemode) (defaults to: '0755')

    Default mode for all executable files (set via Hiera to allow defaults on all defined types)

  • modprobe_d (Stdlib::Unixpath) (defaults to: '/etc/modprobe.d')

    Location of ‘modprobe.d` directory

  • modprobe_d_files (Array[Stdlib::Unixpath]) (defaults to: [ '/etc/modprobe.d/modprobe.conf', '/etc/modprobe.d/aliases.conf', '/etc/modprobe.d/blacklist.conf', ])

    Default files to create in ‘modprobe.d` directory



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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'manifests/init.pp', line 18

class kmod (
  Hash                    $list_of_aliases    = {},
  Hash                    $list_of_blacklists = {},
  Hash                    $list_of_installs   = {},
  Hash                    $list_of_loads      = {},
  Hash                    $list_of_options    = {},
  String[1]               $owner              = 'root',
  String[1]               $group              = 'root',
  Stdlib::Filemode        $directory_mode     = '0755',
  Stdlib::Filemode        $file_mode          = '0644',
  Stdlib::Filemode        $exe_mode           = '0755',
  Stdlib::Unixpath        $modprobe_d         = '/etc/modprobe.d',
  Array[Stdlib::Unixpath] $modprobe_d_files   = [
    '/etc/modprobe.d/modprobe.conf',
    '/etc/modprobe.d/aliases.conf',
    '/etc/modprobe.d/blacklist.conf',
  ],
) {
  file { $modprobe_d:
    ensure => directory,
    owner  => $owner,
    group  => $group,
    mode   => $directory_mode,
  }

  file { $modprobe_d_files:
    ensure => file,
    owner  => $owner,
    group  => $group,
    mode   => $file_mode,
  }

  $list_of_aliases.each | $name, $data | {
    kmod::alias { $name:
      * => $data,
    }
  }
  $list_of_blacklists.each | $name, $data | {
    kmod::blacklist { $name:
      * => $data,
    }
  }
  $list_of_installs.each | $name, $data | {
    kmod::install { $name:
      * => $data,
    }
  }
  $list_of_loads.each | $name, $data | {
    kmod::load { $name:
      * => $data,
    }
  }
  $list_of_options.each | $name, $data | {
    kmod::option { $name:
      * => $data,
    }
  }
}