voxpupuli / puppet-kmod

manage kernel module with puppet
Apache License 2.0
17 stars 63 forks source link
archlinux-puppet-module centos-puppet-module debian-puppet-module hacktoberfest linux-puppet-module oraclelinux-puppet-module puppet redhat-puppet-module sles-puppet-module ubuntu-puppet-module

Kmod Puppet module

Build Status Release Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores puppetmodule.info docs Apache 2 License Donated by Camptocamp

Description

This module provides definitions to manipulate modprobe.conf (5) stanzas:

It depends on Augeas with the modprobe lens.

Usage

This module has five main defined types:

kmod::load

Loads a module using modprobe and manages persistent modules in /etc/sysconfig/modules

  kmod::load { 'mymodule': }

kmod::alias

Adds an alias to modprobe.conf, by default /etc/modprobe.d/<name>.conf is assumed for a filename.

  kmod::alias { 'bond0':
    source => 'bonding',
  }

Params:

kmod::option

Adds an option to modprobe.conf

  kmod::option { 'bond0 mode':
    module  => 'bond0',
    option  => 'mode',
    value   => '1',
  }

  kmod::option { 'bond0':
    option => 'mode',
    value  => '1',
  }

Params:

kmod::blacklist

Manages modprobe blacklist entries. Blacklist entries prevents module aliases from being used, but would not prevent the module from being loaded. To prevent a module from being loaded use kmod::install

  kmod::blacklist { 'foo': }

Params:

kmod::install

Manage modprobe install entries

   kmod::install { 'pcspkr': }

If you want to ensure that module can't be loaded at all you can do the following:

   kmod::install { 'dccp': command => '/bin/false' }

Params:

Using the module with hiera

The module makes available lists for every defined type that will create those defined types if defined as class parameters. The parameters are:

Example usage:

---
kmod::list_of_blacklists:
  'foo01': {}
  'foo02': {}
  'foo03': {}
kmod::list_of_aliases:
  'foo01':
    source: 'squashfs'
    aliasname: 'squash01'
  'foo02':
    source: 'squashfs'
    aliasname: 'squash02'
kmod::list_of_installs:
  'dccp':
    command: '/bin/false'
  'blah':
    command: '/bin/true'
kmod::list_of_loads:
  'cramfs': {}
  'vfat': {}
kmod::list_of_options:
  'bond0 mode':
    module: 'bond0'
    option: 'mode'
    value: '1'
  'bond0':
    option: 'mode'
    value: '1'

Contributing

Please report bugs and feature request using GitHub issue tracker.

For pull requests, it is very much appreciated to check your Puppet manifest with puppet-lint to follow the recommended Puppet style guidelines from the Puppet Labs style guide.

Transfer Notice

This plugin was originally authored by Camptocamp. The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance. Existing pull requests and issues were transferred over, please fork and continue to contribute here instead of Camptocamp.

Previously: https://github.com/camptocamp/puppet-kmod