diff options
author | martin f. krafft <madduck@madduck.net> | 2010-10-04 23:02:32 +0200 |
---|---|---|
committer | R.I.Pienaar <rip@devco.net> | 2010-10-04 22:46:18 +0100 |
commit | af63a0b3eb0a528e39992e1f10c07d8a78a84e77 (patch) | |
tree | 926ce912d4be2089b4a7d0f8981a68356150f72c /manifests | |
parent | 2a3abe58a633b7b635c57d690905af28b7273b93 (diff) | |
download | puppet-concat-af63a0b3eb0a528e39992e1f10c07d8a78a84e77.tar.gz puppet-concat-af63a0b3eb0a528e39992e1f10c07d8a78a84e77.tar.bz2 |
Parametrize warning message
The concat warn parameter can now be any string (and needs to include
the appropriate commenting character) and will then override the default
(which still gets printed when warn=>true).
Signed-off-by: martin f. krafft <madduck@madduck.net>
Diffstat (limited to 'manifests')
-rw-r--r--[-rwxr-xr-x] | manifests/fragment.pp | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | manifests/init.pp | 13 | ||||
-rw-r--r--[-rwxr-xr-x] | manifests/setup.pp | 0 |
3 files changed, 10 insertions, 3 deletions
diff --git a/manifests/fragment.pp b/manifests/fragment.pp index 890d43a..890d43a 100755..100644 --- a/manifests/fragment.pp +++ b/manifests/fragment.pp diff --git a/manifests/init.pp b/manifests/init.pp index 41a65ba..b94411c 100755..100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -93,11 +93,18 @@ define concat($mode = 0644, $owner = "root", $group = "root", $warn = "false", $ $version = $concat::setup::majorversion $fragdir = "${concatdir}/${safe_name}" $concat_name = "fragments.concat.out" + $default_warn_message = '# This file is managed by Puppet. DO NOT EDIT.' case $warn { - 'true',true,yes,on: { $warnflag = "-w" } - 'false',false,no,off: { $warnflag = "" } - default: { fail("Improper 'warn' value given to concat: $warn") } + 'true',true,yes,on: { $warnmsg = "$default_warn_message" } + 'false',false,no,off: { $warnmsg = "" } + default: { $warnmsg = "$warn" } + } + + $warnmsg_escaped = regsubst($warnmsg, "'", "'\\\\''", 'G') + $warnflag = $warnmsg_escaped ? { + '' => '', + default => "-w '$warnmsg_escaped'" } case $force { diff --git a/manifests/setup.pp b/manifests/setup.pp index 9676fb6..9676fb6 100755..100644 --- a/manifests/setup.pp +++ b/manifests/setup.pp |