Merge pull request #11 from cwarden/fully-qualify
Fix use of unqualified variable names
This commit is contained in:
commit
61c8d5c75b
3 changed files with 7 additions and 6 deletions
|
@ -13,7 +13,7 @@
|
||||||
# - group Owner of the file
|
# - group Owner of the file
|
||||||
# - backup Controls the filebucketing behavior of the final file and
|
# - backup Controls the filebucketing behavior of the final file and
|
||||||
# see File type reference for its use. Defaults to 'puppet'
|
# 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_name = regsubst($name, '/', '_', 'G')
|
||||||
$safe_target_name = regsubst($target, '/', '_', 'G')
|
$safe_target_name = regsubst($target, '/', '_', 'G')
|
||||||
$concatdir = $concat::setup::concatdir
|
$concatdir = $concat::setup::concatdir
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
# ALIASES:
|
# ALIASES:
|
||||||
# - The exec can notified using Exec["concat_/path/to/file"] or Exec["concat_/path/to/directory"]
|
# - 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"]
|
# - 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')
|
$safe_name = regsubst($name, '/', '_', 'G')
|
||||||
$concatdir = $concat::setup::concatdir
|
$concatdir = $concat::setup::concatdir
|
||||||
$version = $concat::setup::majorversion
|
$version = $concat::setup::majorversion
|
||||||
|
@ -126,7 +126,7 @@ define concat($mode = 0644, $owner = $id, $group = $concat::setup::root_group, $
|
||||||
}
|
}
|
||||||
|
|
||||||
File{
|
File{
|
||||||
owner => $id,
|
owner => $::id,
|
||||||
group => $group,
|
group => $group,
|
||||||
mode => $mode,
|
mode => $mode,
|
||||||
backup => $backup
|
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}",
|
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}",
|
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}"]{
|
Exec["concat_${name}"]{
|
||||||
user => root,
|
user => root,
|
||||||
group => $group,
|
group => $group,
|
||||||
|
|
|
@ -13,12 +13,13 @@
|
||||||
#
|
#
|
||||||
# It also copies out the concatfragments.sh file to /usr/local/bin
|
# It also copies out the concatfragments.sh file to /usr/local/bin
|
||||||
class concat::setup {
|
class concat::setup {
|
||||||
|
$id = $::id
|
||||||
$root_group = $id ? {
|
$root_group = $id ? {
|
||||||
root => 0,
|
root => 0,
|
||||||
default => $id
|
default => $id
|
||||||
}
|
}
|
||||||
$concatdir = $concat_basedir
|
$concatdir = $::concat_basedir
|
||||||
$majorversion = regsubst($puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
|
$majorversion = regsubst($::puppetversion, '^[0-9]+[.]([0-9]+)[.][0-9]+$', '\1')
|
||||||
|
|
||||||
file{"${concatdir}/bin/concatfragments.sh":
|
file{"${concatdir}/bin/concatfragments.sh":
|
||||||
owner => $id,
|
owner => $id,
|
||||||
|
|
Loading…
Reference in a new issue