Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdlib::manage: Also permit templates for concat::fragment #1434

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions manifests/manage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@
$create_resources.each |$type, $resources| {
$resources.each |$title, $attributes| {
case $type {
'file': {
'file', 'concat::fragment': {
# sanity checks
# epp, erb and content are exclusive
if 'epp' in $attributes and 'content' in $attributes {
fail("You can not set 'epp' and 'content' for file ${title}")
fail("You can not set 'epp' and 'content' for ${type} ${title}")
}
if 'erb' in $attributes and 'content' in $attributes {
fail("You can not set 'erb' and 'content' for file ${title}")
fail("You can not set 'erb' and 'content' for ${type} ${title}")
}
if 'erb' in $attributes and 'epp' in $attributes {
fail("You can not set 'erb' and 'epp' for file ${title}")
fail("You can not set 'erb' and 'epp' for ${type} ${title}")
}

if 'epp' in $attributes {
Expand All @@ -91,20 +91,20 @@
$content = epp($attributes['epp']['template'])
}
} else {
fail("No template configured for epp for file ${title}")
fail("No template configured for epp for ${type} ${title}")
}
} elsif 'erb' in $attributes {
if 'template' in $attributes['erb'] {
$content = template($attributes['erb']['template'])
} else {
fail("No template configured for erb for file ${title}")
fail("No template configured for erb for ${type} ${title}")
}
} elsif 'content' in $attributes {
$content = $attributes['content']
} else {
$content = undef
}
file { $title:
$type { $title:
* => $attributes - 'erb' - 'epp' - 'content',
content => $content,
}
Expand Down
Loading