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 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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
# Kmod Puppet module
[](https://github.com/voxpupuli/puppet-kmod/actions?query=workflow%3ACI)
[](https://github.com/voxpupuli/puppet-kmod/actions/workflows/release.yml)
[](https://forge.puppetlabs.com/puppet/kmod)
[](https://forge.puppetlabs.com/puppet/kmod)
[](https://forge.puppetlabs.com/puppet/kmod)
[](https://forge.puppetlabs.com/puppet/kmod)
[](http://www.puppetmodule.info/m/puppet-kmod)
[](LICENSE)
[](#transfer-notice)
## Description
This module provides definitions to manipulate modprobe.conf (5) stanzas:
* kmod::alias
* kmod::install
* kmod::blacklist
It depends on Augeas with the modprobe lens.
## Usage
This module has five main defined types:
* kmod::load
* kmod::alias
* kmod::option
* kmod::install
* kmod::blacklist
### kmod::load
Loads a module using modprobe and manages persistent modules in /etc/sysconfig/modules
```puppet
kmod::load { 'mymodule': }
```
### kmod::alias
Adds an alias to modprobe.conf, by default `/etc/modprobe.d/<name>.conf` is assumed for a filename.
```puppet
kmod::alias { 'bond0':
source => 'bonding',
}
```
Params:
* `source`: Name of the module to alias
* `aliasname`: Name of the alias (defaults to the resource title)
* `file`: File to write to (see above default)
### kmod::option
Adds an option to modprobe.conf
```puppet
kmod::option { 'bond0 mode':
module => 'bond0',
option => 'mode',
value => '1',
}
kmod::option { 'bond0':
option => 'mode',
value => '1',
}
```
Params:
* `option`: Name of the parameter to add
* `value`: Value of the parameter
* `module`: Name of the module (if ommited, the resource title is used)
* `file`: File to write to (defaults to `/etc/modprobe.d/<module name>.conf`)
### 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`
```puppet
kmod::blacklist { 'foo': }
```
Params:
* `file`: File to write to, defaults to `/etc/modprobe.d/blacklist.conf`
### kmod::install
Manage modprobe install entries
```puppet
kmod::install { 'pcspkr': }
```
If you want to ensure that module can't be loaded at all you can do the following:
```puppet
kmod::install { 'dccp': command => '/bin/false' }
```
Params:
* `file`: File to write to (defaults to `/etc/modprobe.d/<module name>.conf`)
* `command`: (optional) command associated with the install, defaults to `/bin/true`
## 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:
* kmod::list_of_blacklists:
* kmod::list_of_aliases:
* kmod::list_of_installs:
* kmod::list_of_loads:
* kmod::list_of_options:
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](https://github.com/camptocamp/puppet-kmod/issues).
For pull requests, it is very much appreciated to check your Puppet manifest
with [puppet-lint](https://github.com/camptocamp/puppet-kmod/issues) to follow the recommended Puppet style guidelines from the
[Puppet Labs style guide](http://docs.puppetlabs.com/guides/style_guide.html).
## Transfer Notice
This plugin was originally authored by [Camptocamp](http://www.camptocamp.com).
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
|