diff options
author | R.I.Pienaar <rip@devco.net> | 2011-12-06 09:11:59 -0800 |
---|---|---|
committer | R.I.Pienaar <rip@devco.net> | 2011-12-06 09:11:59 -0800 |
commit | 61c8d5c75b00e7c28d316ef427f43fd2d6817c76 (patch) | |
tree | e41cba29bcb6d4f1d3059996c471a910d01ed800 | |
parent | 0cd6bacfc92e581a988c2c82cc23472dff63a8b0 (diff) | |
parent | 772241575315a4881ec0e01ac12ee6549970ef30 (diff) | |
download | puppet-concat-61c8d5c75b00e7c28d316ef427f43fd2d6817c76.tar.gz puppet-concat-61c8d5c75b00e7c28d316ef427f43fd2d6817c76.tar.bz2 |
Merge pull request #11 from cwarden/fully-qualify
Fix use of unqualified variable names
-rw-r--r-- | manifests/fragment.pp | 2 | ||||
-rw-r--r-- | manifests/init.pp | 6 | ||||
-rw-r--r-- | manifests/setup.pp | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/manifests/fragment.pp b/manifests/fragment.pp index 1fb4128..97c0d9c 100644 --- a/manifests/fragment.pp +++ b/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 = $id, $group = $concat::setup::root_group, $backup = "puppet") { +define concat::fragment($target, $content='', $source='', $order=10, $ensure = "present", $mode = 0644, $owner = $::id, $group = $concat::setup::root_group, $backup = "puppet") { $safe_name = regsubst($name, '/', '_', 'G') $safe_target_name = regsubst($target, '/', '_', 'G') $concatdir = $concat::setup::concatdir diff --git a/manifests/init.pp b/manifests/init.pp index 19d91a1..f1fbc9f 100644 --- a/manifests/init.pp +++ b/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 = $id, $group = $concat::setup::root_group, $warn = "false", $force = "false", $backup = "puppet", $gnu = "true", $order="alpha") { +define concat($mode = 0644, $owner = $::id, $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 @@ -126,7 +126,7 @@ define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $ } File{ - owner => $id, + owner => $::id, group => $group, mode => $mode, backup => $backup @@ -171,7 +171,7 @@ define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $ unless => "${concat::setup::concatdir}/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} -t ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", command => "${concat::setup::concatdir}/bin/concatfragments.sh -o ${fragdir}/${concat_name} -d ${fragdir} ${warnflag} ${forceflag} ${orderflag} ${gnuflag}", } - if $id == 'root' { + if $::id == 'root' { Exec["concat_${name}"]{ user => root, group => $group, diff --git a/manifests/setup.pp b/manifests/setup.pp index 53092ab..2c1d343 100644 --- a/manifests/setup.pp +++ b/manifests/setup.pp @@ -13,12 +13,13 @@ # # It also copies out the concatfragments.sh file to /usr/local/bin class concat::setup { + $id = $::id $root_group = $id ? { root => 0, default => $id } - $concatdir = $concat_basedir - $majorversion = regsubst($puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1') + $concatdir = $::concat_basedir + $majorversion = regsubst($::puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1') file{"${concatdir}/bin/concatfragments.sh": owner => $id, |