Skip to content

Commit

Permalink
systemd::udev::rule: param rules now defaults to []
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 1, 2022
1 parent 28dca2c commit c18128f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manifests/udev/rule.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# The literal udev rules you want to deploy
#
define systemd::udev::rule (
Array $rules,
Array $rules = [],
Enum['present', 'absent', 'file'] $ensure = 'present',
Stdlib::Absolutepath $path = '/etc/udev/rules.d',
Variant[Array[String[1]], String[1]] $notify_services = [],
Expand All @@ -34,6 +34,9 @@
$filename = assert_type(Pattern['^.+\.rules$'], $name) |$expected, $actual| {
fail("The \$name should match \'${expected}\', you passed \'${actual}\'")
}
if $ensure in ['file', 'present'] and empty($rules) {
fail("systemd::udev::rule - ${name}: param rules is empty, you need to pass rules")
}

file { $filename:
ensure => $ensure,
Expand Down

0 comments on commit c18128f

Please sign in to comment.