Skip to content

Commit 148c496

Browse files
committed
Add support for epp template params
1 parent dba70f7 commit 148c496

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

manifests/conf.pp

+9-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Source of configuration snippet
1717
#
1818
# @param template
19-
# Path of a template file
19+
# Path of a erb template file or epp template file without parameters
2020
#
2121
# @param sudo_config_dir
2222
# Where to place configuration snippets.
@@ -40,6 +40,7 @@
4040
$content = undef,
4141
$source = undef,
4242
$template = undef,
43+
$template_epp = undef,
4344
$sudo_config_dir = undef,
4445
$sudo_file_name = undef,
4546
$sudo_syntax_path = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
@@ -94,6 +95,10 @@
9495
}
9596
}
9697

98+
if $template and $template_epp {
99+
fail("'template' and 'template_epp' are mutually exclusive")
100+
}
101+
97102
if $content != undef {
98103
if $content =~ Array {
99104
$lines = join($content, "\n")
@@ -104,10 +109,11 @@
104109
} elsif $template != undef {
105110
if $template =~ /\.epp$/ {
106111
$content_real = epp($template)
107-
}
108-
else {
112+
} else {
109113
$content_real = template($template)
110114
}
115+
} elsif $template_epp != undef {
116+
$content_real = epp($template_epp[filename], $template_epp[params])
111117
} else {
112118
$content_real = undef
113119
}

0 commit comments

Comments
 (0)