Defined Type: sysfs::conffile

Defined in:
modules/sysfs/manifests/conffile.pp

Overview

Define: sysfs::conffile

Represents a file with sysfs kernel parameters in /etc/sysfs.d.

Parameters

content

The content of the file provided as a string. Either this or 'source' must be specified.

source

The content of the file provided as a puppet:/// file reference. Either this or 'content' must be specified.

priority

A numeric value in range 60 - 99. In case of conflict, files with a higher priority override files with a lower priority.

If you're not sure, leave this unspecified. The default value of 60 should suit most cases.

Examples

sysfs::conffile { 'hadoop':
  content  => template('hadoop/hadoop.conf.erb'),
  priority => 90,
}

Parameters:

  • ensure (Any) (defaults to: present)
  • content (Any) (defaults to: undef)
  • source (Any) (defaults to: undef)
  • priority (Any) (defaults to: 70)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'modules/sysfs/manifests/conffile.pp', line 29

define sysfs::conffile(
    $ensure   = present,
    $content  = undef,
    $source   = undef,
    $priority = 70
) {
    include ::sysfs

    # TODO/puppet4 convert parameter to use the appropriate type
    validate_numeric($priority, 99, 0)

    $basename = regsubst($title, '\W', '-', 'G')
    $filename = sprintf('/etc/sysfs.d/%02d-%s.conf', $priority, $basename)

    file { $filename:
        ensure  => $ensure,
        content => $content,
        source  => $source,
        notify  => Service['sysfsutils'],
    }
}