summaryrefslogtreecommitdiff
path: root/manifests/fragment.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/fragment.pp')
-rw-r--r--manifests/fragment.pp60
1 files changed, 29 insertions, 31 deletions
diff --git a/manifests/fragment.pp b/manifests/fragment.pp
index 97c0d9c..943bf67 100644
--- a/manifests/fragment.pp
+++ b/manifests/fragment.pp
@@ -13,39 +13,37 @@
# - group Owner of the file
# - backup Controls the filebucketing behavior of the final file and
# see File type reference for its use. Defaults to 'puppet'
-define concat::fragment($target, $content='', $source='', $order=10, $ensure = "present", $mode = 0644, $owner = $::id, $group = $concat::setup::root_group, $backup = "puppet") {
- $safe_name = regsubst($name, '/', '_', 'G')
- $safe_target_name = regsubst($target, '/', '_', 'G')
- $concatdir = $concat::setup::concatdir
- $fragdir = "${concatdir}/${safe_target_name}"
+define concat::fragment($target, $content='', $source='', $order=10, $ensure = 'present', $mode = '0644', $owner = $::id, $group = $concat::setup::root_group, $backup = 'puppet') {
+ $safe_name = regsubst($name, '/', '_', 'G')
+ $safe_target_name = regsubst($target, '/', '_', 'G')
+ $concatdir = $concat::setup::concatdir
+ $fragdir = "${concatdir}/${safe_target_name}"
- # if content is passed, use that, else if source is passed use that
- # if neither passed, but $ensure is in symlink form, make a symlink
- case $content {
- "": {
- case $source {
- "": {
- case $ensure {
- "", "absent", "present", "file", "directory": {
- crit("No content, source or symlink specified")
- }
- }
- }
- default: { File{ source => $source } }
- }
+ # if content is passed, use that, else if source is passed use that
+ # if neither passed, but $ensure is in symlink form, make a symlink
+ case $content {
+ '': {
+ case $source {
+ '': {
+ case $ensure {
+ '', 'absent', 'present', 'file', 'directory': {
+ crit('No content, source or symlink specified')
}
- default: { File{ content => $content } }
+ }
+ }
+ default: { File{ source => $source } }
+ }
}
+ default: { File{ content => $content } }
+ }
- file{"${fragdir}/fragments/${order}_${safe_name}":
- mode => $mode,
- owner => $owner,
- group => $group,
- ensure => $ensure,
- backup => $backup,
- alias => "concat_fragment_${name}",
- notify => Exec["concat_${target}"]
- }
+ file{"${fragdir}/fragments/${order}_${safe_name}":
+ ensure => $ensure,
+ mode => $mode,
+ owner => $owner,
+ group => $group,
+ backup => $backup,
+ alias => "concat_fragment_${name}",
+ notify => Exec["concat_${target}"]
+ }
}
-
-# vi:tabstop=4:expandtab:ai