]> gitweb.fluxo.info Git - puppet-concat.git/commitdiff
Make the filebucket behavior of files configurable
authorR.I.Pienaar <rip@devco.net>
Wed, 14 Jul 2010 12:01:45 +0000 (13:01 +0100)
committerR.I.Pienaar <rip@devco.net>
Wed, 14 Jul 2010 12:01:45 +0000 (13:01 +0100)
CHANGELOG
manifests/fragment.pp
manifests/init.pp

index 90611b4314c5b823b3b8d5e0eb3bc6fae282196e..b09f4ebbcce63f4f8141dd1a5e69ff407f4e752f 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -23,3 +23,4 @@ CHANGELOG:
                to include the contents of a symlink into the final file.
 - 2010/04/16 - Add more cleaning of the fragment name - removing / from the $name
 - 2010/05/22 - Improve documentation and show the use of ensure =>
+- 2010/07/14 - Add support for setting the filebucket behavior of files
index cc21f39ef4d57327f23fbce56e44b2f46ed6c09a..890d43a4bc8edc5f1bd9be2181854a42fd8fe599 100755 (executable)
@@ -11,7 +11,9 @@
 #   - mode      Mode for the file
 #   - owner     Owner of the file
 #   - group     Owner of the file
-define concat::fragment($target, $content='', $source='', $order=10, $ensure = "present", $mode = 0644, $owner = root, $group = root) {
+#   - 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 = root, $group = root, $backup = "puppet") {
     $safe_name = regsubst($name, '/', '_', 'G')
     $safe_target_name = regsubst($target, '/', '_', 'G')
     $concatdir = $concat::setup::concatdir
@@ -40,6 +42,7 @@ define concat::fragment($target, $content='', $source='', $order=10, $ensure = "
         owner  => $owner,
         group  => $group,
         ensure => $ensure,
+        backup => $backup,
         alias  => "concat_fragment_${name}",
         notify => Exec["concat_${target}"]
     }
index 745eba6e3a123376f3f00d7b9f7e3aad621996ce..41a65ba6c071566733bb6aadef4201c1e3426657 100755 (executable)
@@ -71,6 +71,8 @@
 #  - force      Enables creating empty files if no fragments are present
 #  - warn       Adds a normal shell style comment top of the file indicating
 #               that it is built by puppet
+#  - backup     Controls the filebucketing behavior of the final file and
+#               see File type reference for its use.  Defaults to 'puppet'
 #
 # ACTIONS:
 #  - Creates fragment directories if it didn't exist already
@@ -85,7 +87,7 @@
 # ALIASES:
 #  - The exec can notified using Exec["concat_/path/to/file"] or Exec["concat_/path/to/directory"]
 #  - The final file can be referened as File["/path/to/file"] or File["concat_/path/to/file"]  
-define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $force = "false") {
+define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $force = "false", $backup = "puppet") {
     $safe_name   = regsubst($name, '/', '_', 'G')
     $concatdir   = $concat::setup::concatdir
     $version     = $concat::setup::majorversion
@@ -105,9 +107,10 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $
     }
 
     File{
-        owner => root,
-        group => root,
-        mode  => $mode,
+        owner  => root,
+        group  => root,
+        mode   => $mode,
+        backup => $backup
     }
 
     file{$fragdir: