Skip to content

Commit f6d7771

Browse files
committed
stdlib::manage: Also permit templates for concat::fragment
1 parent a01ed37 commit f6d7771

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

manifests/manage.pp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@
7070
$create_resources.each |$type, $resources| {
7171
$resources.each |$title, $attributes| {
7272
case $type {
73-
'file': {
73+
'file', 'concat::fragment': {
7474
# sanity checks
7575
# epp, erb and content are exclusive
7676
if 'epp' in $attributes and 'content' in $attributes {
77-
fail("You can not set 'epp' and 'content' for file ${title}")
77+
fail("You can not set 'epp' and 'content' for ${type} ${title}")
7878
}
7979
if 'erb' in $attributes and 'content' in $attributes {
80-
fail("You can not set 'erb' and 'content' for file ${title}")
80+
fail("You can not set 'erb' and 'content' for ${type} ${title}")
8181
}
8282
if 'erb' in $attributes and 'epp' in $attributes {
83-
fail("You can not set 'erb' and 'epp' for file ${title}")
83+
fail("You can not set 'erb' and 'epp' for ${type} ${title}")
8484
}
8585

8686
if 'epp' in $attributes {
@@ -91,20 +91,20 @@
9191
$content = epp($attributes['epp']['template'])
9292
}
9393
} else {
94-
fail("No template configured for epp for file ${title}")
94+
fail("No template configured for epp for ${type} ${title}")
9595
}
9696
} elsif 'erb' in $attributes {
9797
if 'template' in $attributes['erb'] {
9898
$content = template($attributes['erb']['template'])
9999
} else {
100-
fail("No template configured for erb for file ${title}")
100+
fail("No template configured for erb for ${type} ${title}")
101101
}
102102
} elsif 'content' in $attributes {
103103
$content = $attributes['content']
104104
} else {
105105
$content = undef
106106
}
107-
file { $title:
107+
$type { $title:
108108
* => $attributes - 'erb' - 'epp' - 'content',
109109
content => $content,
110110
}

0 commit comments

Comments
 (0)