- include concat::setup
-
- $safe_name = regsubst($name, '[/:\n]', '_', 'GM')
- $safe_target_name = regsubst($target, '[/:\n]', '_', 'GM')
- $concatdir = $concat::setup::concatdir
- $fragdir = "${concatdir}/${safe_target_name}"
- $fragowner = $concat::setup::fragment_owner
- $fraggroup = $concat::setup::fragment_group
- $fragmode = $concat::setup::fragment_mode
-
- # The file type's semantics are problematic in that ensure => present will
- # not over write a pre-existing symlink. We are attempting to provide
- # backwards compatiblity with previous concat::fragment versions that
- # supported the file type's ensure => /target syntax
-
- # be paranoid and only allow the fragment's file resource's ensure param to
- # be file, absent, or a file target
- $safe_ensure = $my_ensure ? {
- '' => 'file',
- undef => 'file',
- 'file' => 'file',
- 'present' => 'file',
- 'absent' => 'absent',
- default => $my_ensure,
- }
-
- # if it looks line ensure => /target syntax was used, fish that out
- if ! ($my_ensure in ['', 'present', 'absent', 'file' ]) {
- $ensure_target = $my_ensure
- } else {
- $ensure_target = undef
- }
-
- # the file type's semantics only allows one of: ensure => /target, content,
- # or source
- if ($ensure_target and $source) or
- ($ensure_target and $content) or
- ($source and $content) {
- fail('You cannot specify more than one of $content, $source, $ensure => /target')
- }
-
- if ! ($content or $source or $ensure_target) {