diff --git a/manifests/udev/rule.pp b/manifests/udev/rule.pp index 06b65c4a..d1708737 100644 --- a/manifests/udev/rule.pp +++ b/manifests/udev/rule.pp @@ -43,7 +43,7 @@ owner => 'root', group => 'root', mode => '0444', - notify => $notify_services, + notify => $notify_services << 'Exec[systemd-udev_reload]', selinux_ignore_defaults => $selinux_ignore_defaults, content => epp("${module_name}/udev_rule.epp", { 'rules' => $rules }), } diff --git a/manifests/udevd.pp b/manifests/udevd.pp index 92635b5d..a560372b 100644 --- a/manifests/udevd.pp +++ b/manifests/udevd.pp @@ -36,4 +36,11 @@ * => $udev_rule, } } + + exec { 'systemd-udev_reload': + command => 'udevadm control --reload-rules && udevadm trigger', + refreshonly => true, + path => $facts['path'], + } + } diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 1be26d8a..50be9471 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -701,6 +701,8 @@ 'ACTION=="add", KERNEL=="sdb", RUN+="/bin/raw /dev/raw/raw2 %N"', ]) } + + it { is_expected.to contain_file('/etc/udev/rules.d/example_raw.rules').that_notifies('Exec[systemd-udev_reload]') } end context 'with machine-info' do