-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add class udev::udevadm to manage
udevadm trigger
- Loading branch information
Joshua Hoblitt
committed
Sep 19, 2013
1 parent
b6821fe
commit 112ebab
Showing
6 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
# | ||
class udev::params { | ||
$udev_package = 'udev' | ||
$udevadm_path = '/sbin' | ||
|
||
case $::osfamily { | ||
'redhat': {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# == Class: udev::udevadm | ||
# | ||
# This class should not being included into the manifest directly. It's | ||
# function is to receive messages that the udev configuration files have | ||
# changed. | ||
# | ||
# === Example | ||
# | ||
# file { '/etc/etc/udev/rules.d/99-myfrobnicator.rules': | ||
# ... | ||
# notify => Class['udev::udevadm'], | ||
# } | ||
# | ||
class udev::udevadm inherits udev::params { | ||
|
||
# adding `udevadm control --reload-rules` may be needed some day for edge | ||
# cases. | ||
# http://unix.stackexchange.com/questions/39370/how-to-reload-udev-rules-without-reboot | ||
|
||
exec { 'udevadm trigger': | ||
command => 'udevadm trigger', | ||
refreshonly => true, | ||
path => [$udev::params::udevadm_path], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'spec_helper' | ||
|
||
describe 'udev::udevadm', :type => :class do | ||
|
||
describe 'for osfamily RedHat' do | ||
let(:facts) {{ :osfamily => 'RedHat' }} | ||
|
||
it { should include_class('udev::udevadm') } | ||
it do | ||
should contain_exec('udevadm trigger').with({ | ||
:command => 'udevadm trigger', | ||
:refreshonly => true, | ||
:path => ['/sbin'], | ||
}) | ||
end | ||
end | ||
|
||
end |