]> gitweb.fluxo.info Git - puppet-concat.git/commitdiff
- make the root group configurable in the concat::setup class for portability
authorPierre-Yves Ritschard <pyr@milestonelab.com>
Thu, 3 Feb 2011 17:58:09 +0000 (17:58 +0000)
committerR.I.Pienaar <rip@devco.net>
Thu, 3 Feb 2011 18:01:36 +0000 (18:01 +0000)
- use sh and not bash

CHANGELOG
files/concatfragments.sh
manifests/fragment.pp
manifests/init.pp
manifests/setup.pp

index 238d24619c15e9caa7fab064e6c8217d00ad12b7..c506cf1a5ddd3507215b9cb797f68b3592a17a51 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -26,3 +26,4 @@ CHANGELOG:
 - 2010/07/14 - Add support for setting the filebucket behavior of files
 - 2010/10/04 - Make the warning message configurable
 - 2010/12/03 - Add flags to make concat work better on Solaris - thanks Jonathan Boyett
+- 2011/02/03 - Make the shell script more portable and add a config option for root group
index a8d87656d5be403a5cdc2b05b5ef52a581ec8110..52fd6845366f3093ef081cc4e623672a6ca569db 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Script to concat files to a config file.
 #
index 890d43a4bc8edc5f1bd9be2181854a42fd8fe599..7afc4c07724cbb8c8a942fda77eb4e64dda44c08 100644 (file)
@@ -13,7 +13,7 @@
 #   - 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 = root, $group = root, $backup = "puppet") {
+define concat::fragment($target, $content='', $source='', $order=10, $ensure = "present", $mode = 0644, $owner = root, $group = $concat::setup::root_group, $backup = "puppet") {
     $safe_name = regsubst($name, '/', '_', 'G')
     $safe_target_name = regsubst($target, '/', '_', 'G')
     $concatdir = $concat::setup::concatdir
index 909d7b6f854f33bb8165257ec40d56c26d2ad2dc..3a173467782f606f2abcb356670b1a1c7cdb4f2d 100644 (file)
@@ -87,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", $backup = "puppet", $gnu = "true", $order="alpha") {
+define concat($mode = 0644, $owner = "root", $group = $concat::setup::root_group, $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") {
     $safe_name   = regsubst($name, '/', '_', 'G')
     $concatdir   = $concat::setup::concatdir
     $version     = $concat::setup::majorversion
@@ -127,7 +127,7 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $
 
     File{
         owner  => root,
-        group  => root,
+        group  => $group,
         mode   => $mode,
         backup => $backup
     }
@@ -165,7 +165,7 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $
 
     exec{"concat_${name}":
         user      => root,
-        group     => root,
+        group     => $group,
         notify    => File[$name],
         subscribe => File[$fragdir],
         alias     => "concat_${fragdir}",
index 9676fb665c2fbb6fbe3c25c20d85d2a80c529788..77ba47f5c66789952cdb6a503d7714f88ebf1682 100644 (file)
 #
 # It also copies out the concatfragments.sh file to /usr/local/bin
 class concat::setup {
+    $root_group = 0
     $concatdir = "/var/lib/puppet/concat"
     $majorversion = regsubst($puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
 
     file{"/usr/local/bin/concatfragments.sh": 
             owner  => root,
-            group  => root,
+            group  => $root_group,
             mode   => 755,
             source => $majorversion ? {
                         24      => "puppet:///concat/concatfragments.sh",
@@ -28,7 +29,7 @@ class concat::setup {
          $concatdir: 
             ensure => directory,
             owner  => root,
-            group  => root,
+            group  => $root_group,
             mode   => 755;
     }
 }