Manages the udev package and device rules

Joshua Hoblitt



198,402 latest version

4.6 quality score

Version information

  • 2.3.0 (latest)
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.2.0
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Feb 3rd 2017
This version is compatible with:
  • RedHat

Start using this module


jhoblitt/udev — version 2.3.0 Feb 3rd 2017

Puppet udev Module

Build Status

Table of Contents

  1. Overview
  2. Description
  3. Usage
  4. Limitations
  5. Versioning
  6. Support
  7. Contributing
  8. See Also


Manages the udev package and device rules


This module installs and manages the udev package.



This class does not need to be manually included in the manifest when using the udev::rule defined type.

include udev

Managing udev syslog verbosity

Controls the value of udev_log in udev.conf and change the runtime syslog verbosity of the daemon.

class { 'udev': udev_log => 'debug' }

Managing udev rules

Note that either the content or source parameter must be specified unless ensure is absentand that these parameters are mutually exclusive; you can not specify both.

udev::rule { '60-raw.rules':
  ensure  => present,
  content => 'ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"',

As is commonly done with the file type, you can pass the output of the template() function to content.

udev::rule { '99-foo.rules':
  ensure  => present,
  content => template('mymodule/foo.rules.erb'),
udev::rule { '99-foo.rules':
  ensure  => present,
  source  => "puppet:///modules/${module_name}/foo.rules",
udev::rule { '99-foo.rules':
  ensure  => absent,

Manually triggering a udev device rules reload

file { '/etc/etc/udev/rules.d/99-myfrobnicator.rules':
  notify => Class['udev::udevadm::trigger'],


At present, only support for $::osfamily == 'RedHat' has been implemented. Adding other Linux distributions should be trivial.

This module currently isn't using puppetlabs-concat for building up rule files as that approach presents difficulties in being able to remove an empty file (one without any fragments).

Tested Platforms

  • el6.x
  • el5.x
  • el7.x
  • Debian/Ubuntu

Puppet Version Compatibility

Versions Puppet 2.7 Puppet 3.x Puppet 4.x
1.x yes yes no
2.x no yes yes


This module is versioned according to the Semantic Versioning 2.0.0 specification.


Please log tickets and issues at github


  1. Fork it on github
  2. Make a local clone of your fork
  3. Create a topic branch. Eg, feature/mousetrap
  4. Make/commit changes
    • Commit messages should be in imperative tense
    • Check that linter warnings or errors are not introduced - bundle exec rake lint
    • Check that Rspec-puppet unit tests are not broken and coverage is added for new features - bundle exec rake spec
    • Documentation of API/features is updated as appropriate in the README
    • If present, beaker acceptance tests should be run and potentially updated - bundle exec rake beaker
  5. When the feature is complete, rebase / squash the branch history as necessary to remove "fix typo", "oops", "whitespace" and other trivial commits
  6. Push the topic branch to github
  7. Open a Pull Request (PR) from the topic branch onto parent repo's master branch

See Also