Giter Club home page Giter Club logo

puppet-udev's Introduction

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

Overview

Manages the udev package and device rules

Description

This module installs and manages the udev package.

Usage

Simple

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,
}

Rules may also be created as a parameter off of the udev class

class { 'udev':
  rules => { '99-foo.rules':
               ensure  => present,
               content => template('mymodule/foo.rules.erb'), }
}

Manually triggering a udev device rules reload

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

Limitations

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
  • el8.x
  • el9.x
  • Debian/Ubuntu

Puppet Version Compatibility

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

Versioning

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

Support

Please log tickets and issues at github

Contributing

  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

puppet-udev's People

Contributors

codec avatar csmithxtx avatar janfickler avatar jcpunk avatar jhoblitt avatar kobybr avatar nenioscio avatar oholiab avatar pecastro avatar sam-wouters avatar sazzle2611 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

puppet-udev's Issues

Trailing comma in class definitions

Hi,

The trailing comma in class definitions is causing failures on RHEL6 with puppet from EPEL.

Removing these trailing commas will make the module more portable.

Thanks,
Spenser

deprecation warning

the module currently uses deprecated functions.

Warning: This method is deprecated, please use the stdlib validate_legacy function, with Pattern[]. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/devvm/modules/udev/manifests/init.pp", 27]

could you please resolve them and issue a new release?

Trigger for an --action=add is not working

I have a udev rule that increases block timeouts for virtual machine block devices:

# cat /etc/udev/rules.d/99-blk-timeout.rules 
ACTION=="add", SUBSYSTEMS=="scsi", ATTRS{vendor}=="VMware*", ATTRS{model}=="Virtual disk*", RUN+="/bin/sh -c 'echo 119 >/sys$DEVPATH/timeout'"

Executing a simple udevadm trigger does not invoke the "add" event needed to apply this rule.

To get this to work from the command like i have to run the following:

udevadm trigger --action="add" --subsystem-match="scsi" --attr-match=vendor="VMware*" --attr-match=model="Virtual disk*"

Or, in the case of puppet i've created an exec {} resources to perform this.

  # Set timeout to 120 seconds for all VMware block devices
  # to test: udevadm info -q all -a /dev/sda | grep timeout
  udev::rule { '99-blk-timeout.rules':
    ensure  => present,
    content => "ACTION==\"add\", SUBSYSTEMS==\"scsi\", ATTRS{vendor}==\"VMware*\", ATTRS{model}==\"Virtual disk*\", RUN+=\"/bin/sh -c 'echo 119 >/sys\$DEVPATH/timeout\'\"\n",
    notify  => Exec['udevadm trigger 99-blk-timeout.rules'],
  }
  # end udev rule
  exec { 'udevadm trigger 99-blk-timeout.rules':
    command     => '/usr/sbin/udevadm trigger --action="add" --subsystem-match="scsi" --attr-match=vendor="VMware*" --attr-match=model="Virtual disk*"',
    refreshonly => true,
    subscribe   => Udev::Rule['99-blk-timeout.rules'],
  }
  # end execute udevadm trigger

This is an OK solution, however udevadm trigger is being called twice. Once by udevadm::trigger and once by my exec call.

It would be awesome if we could pass in additional options into the udevadm trigger command so i didn't need my extra exec resource.

Maybe something like:

  udev::rule { '99-blk-timeout.rules':
    ensure  => present,
    content => "ACTION==\"add\", SUBSYSTEMS==\"scsi\", ATTRS{vendor}==\"VMware*\", ATTRS{model}==\"Virtual disk*\", RUN+=\"/bin/sh -c 'echo 119 >/sys\$DEVPATH/timeout\'\"\n",
    trigger_options => '--action="add" --subsystem-match="scsi" --attr-match=vendor="VMware*" --attr-match=model="Virtual disk*"',
  }

Should this module be deprecated in favor of puppet/systemd?

This module has been neglected for a few years and needs modernization to continue to be used. I believe that https://github.com/voxpupuli/puppet-systemd contains equivalent functionality. Is there a [good] reason to modernize this module or should it be officially deprecated in favor of puppet/systemd? Please let me know you are still using this module.

/CC
@sazzle2611
@riton
@schlitzered
@nmaludy
@jcpunk
@Tilum
@Spenser309
@vStone
@kobybr
@hfrenzel
@nexecook
@noodle10000
@ajmaidak
@sam-wouters
@pecastro
@oholiab
@nenioscio
@ekohl

create_resources for a hash parameter?

Could a hash parameter be added to init.pp optionally create udev rules via create resources?

If possible I'd prefer to specify my needed udev rules in an ENC or Hiera. Making a class to contain:

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

is less elegant than setting specifics via the external source.

classes:
  udev:
    rules:
      60-raw.rules:
        content: ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"

[forge] Release EL8 support

Hi,

We're currently using your latest forge module v2.3.0.
We've seen that your master branch does have support for EL8.

Can you please release this version to the Puppet forge ๐Ÿ™

Thanks

Update puppetlabs-stdlib dependancy for version 5

We currently use this module with puppetlabs-stdlib v5.2.0 and it works great but whenever we want to install new modules we get an error that not all dependencies can be satisfied so we have to then add the --ignore-dependencies flag and then have to install all dependencies manually.

If we downgrade to puppetlabs-stdlib < v5 then we will have the same problem as we have other modules that require version greater than 5.

The current situation is workable but it's a pain so would really appreciate it if this could be done.

Thanks,
Sarah

Type error with Puppet v4 parser

With the latest version of puppetserver, we encounter the following error:

Evaluation Error: Error while evaluating a Function Call, 
Module udev is not supported on RedHat release 7 at /etc/puppetlabs/code/environments/production/modules/udev/manifests/params.pp:42:13

We've tested that the error fades away if we cast operatingsystemmajrelease to either string or integer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.