Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- make the root group configurable in the concat::setup class for por…

…tability

- use sh and not bash
  • Loading branch information...
commit 031bf261289dcbb32e63b053ed5b3a82117698c0 1 parent 3c46b82
Pierre-Yves Ritschard authored ripienaar committed
View
1  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
View
2  files/concatfragments.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Script to concat files to a config file.
#
View
2  manifests/fragment.pp
@@ -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
View
6 manifests/init.pp
@@ -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 @@
File{
owner => root,
- group => root,
+ group => $group,
mode => $mode,
backup => $backup
}
@@ -165,7 +165,7 @@
exec{"concat_${name}":
user => root,
- group => root,
+ group => $group,
notify => File[$name],
subscribe => File[$fragdir],
alias => "concat_${fragdir}",
View
5 manifests/setup.pp
@@ -13,12 +13,13 @@
#
# 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 @@
$concatdir:
ensure => directory,
owner => root,
- group => root,
+ group => $root_group,
mode => 755;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.