Skip to content
Snippets Groups Projects
Commit df8b5e43 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

unit_options: Don't require options when ensure absent.

When setting ensure = absent to systemd::unit_options, it doesn't
make sense for users to have to specify the options parameter.  But
it was a mandatory parameter, so they had to.  Fix that.
parent ef6f9645
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ define systemd::unit_options(
# reset that option to the empty list, as systemd would otherwise
# just append the new value(s) to the existing list.
#
$options,
$options=undef,
# List of comment lines to add to the start of the parameter file.
# The list may be nested, and individual "lines" are allowed to
......@@ -77,6 +77,10 @@ define systemd::unit_options(
case $ensure
{
'present': {
if ($options == undef) {
fail("Systemd::Unit_options[${title}]:",
"Parameter 'options' required when ensure = present")
}
cfgfile::directory_parents {
$filepath:
top => $systemd::vars::etcdir,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment