Hi,
Sorry to hassle everyone again, yes I''m a newbie!!
I''ve created some code and I''m getting a out of sync style
error message.
Here''s a snipet of the code (to reproduce the problem):
package { [ "tar", "gzip", "bzip2",
"sed" ]:
ensure => latest
}
define xxx {
$xenrelease = ''3.0.4''
$xenpatchlevel = ''1''
$xenurl = "
http://bits.xensource.com/oss-xen/release/$xenrelease-$xenpatchlevel/src.tgz/
"
$xenfile = "xen-$xenrelease\_$xenpatchlevel-src.tgz"
$xenmd5file = "xen-$xenrelease\_$xenpatchlevel-src.md5"
$targetdir = "/usr/src"
$rulefile = "Rules.mk"
$rulefilecwd
"/usr/src/xen-$xenrelease\_$xenpatchlevel-src/buildconfigs/"
extracttar { "xen-source-verified":
file => "$xenfile",
target => "$targetdir",
options => "zxf",
before => Sedfile["change-to-local-repos"];
}
sedfile { "change-to-local-repos":
file => "$rulefile",
pattern => "s#\(KERNEL_REPO =
\).*#\1$mirror#",
target => "$rulefilecwd";
}
}
define extracttar ( $file = '''', $target =
'''', $options = ''xf'' ) {
case $file {
'''': { err ( "Required valid filename:
''$file''" ) }
}
case $target {
'''': { err ( "Required target
directory: ''$target''" )
}
}
exec { "extracttar-$name":
command => "tar $options $file",
path => "/usr/bin:/usr/sbin:/bin",
cwd => "$target",
require => $operatingsystem ? {
debian => [ Package["tar"],
Package["gzip"],
Package["bzip2"] ]
}
}
}
define sedfile ( $file = '''', $target = '''',
$pattern = '''', $options = ''-i -n
-e'' ) {
case $file {
'''': { err ( "Require valid filename:
''$file''" ) }
}
case $target {
'''': { err ( "Require valid target
directory:
''$target''" ) }
}
exec { "sedfile-$name":
command => "sed $options $pattern $file",
path => "/usr/bin:/usr/sbin:/bin",
cwd => "$target",
logoutput => "true",
require => $operatingsystem ? {
debian => Package["sed"]
}
}
}
class y {
xxx { "zzz": }
}
node a0 {
include y
}
and here''s the error message that I''m receiving:
puppet -v anotest.pp --use-nodes
info: Found a0 in anotest.pp
notice:
//a0/y/xxx[zzz]/extracttar[xen-source-verified]/Exec[extracttar-xen-source-verified]/returns:
executed successfully
Working directory ''/usr/src/xen-3.0.4\_1-src/buildconfigs/''
does not exist
at anotest.pp:67
err:
//a0/y/xxx[zzz]/sedfile[change-to-local-repos]/Exec[sedfile-change-to-local-repos]/returns:
change from notrun to 0 failed: Working directory ''/usr/src/xen-
3.0.4\_1-src/buildconfigs/'' does not exist at anotest.pp:67
Here''s the proof that the directory does exist (after the extract):
ls -l /usr/src/xen-3.0.4_1-src/buildconfigs/
total 352
drwxrwxr-x 2 1103 10020 80 2007-01-08 16:00 conf.linux-native
-rw-r--r-- 1 1103 10020 1411 2007-01-08 16:00 create_config.sh
-rw-r--r-- 1 1103 10020 33744 2007-01-08 16:00 linux-defconfig_xen0_ia64
-rw-r--r-- 1 1103 10020 28852 2007-01-08 16:00 linux-defconfig_xen0_x86_32
-rw-r--r-- 1 1103 10020 27089 2007-01-08 16:00 linux-defconfig_xen0_x86_64
-rw-r--r-- 1 1103 10020 33902 2007-01-08 16:00 linux-defconfig_xen_ia64
-rw-r--r-- 1 1103 10020 30395 2007-01-08 16:00 linux-defconfig_xenU_ia64
-rw-r--r-- 1 1103 10020 17453 2007-01-08 16:00 linux-defconfig_xenU_x86_32
-rw-r--r-- 1 1103 10020 21166 2007-01-08 16:00 linux-defconfig_xenU_x86_64
-rw-r--r-- 1 1103 10020 60780 2007-01-08 16:00 linux-defconfig_xen_x86_32
-rw-r--r-- 1 1103 10020 56892 2007-01-08 16:00 linux-defconfig_xen_x86_64
-rw-r--r-- 1 1103 10020 119 2007-01-08 16:00 mk.linux-2.6-native
-rw-r--r-- 1 1103 10020 2323 2007-01-08 16:00 mk.linux-2.6-xen
-rw-r--r-- 1 1103 10020 58 2007-01-08 16:00 mk.linux-2.6-xen0
-rw-r--r-- 1 1103 10020 58 2007-01-08 16:00 mk.linux-2.6-xenU
-rw-r--r-- 1 1103 10020 4119 2007-01-08 16:00 Rules.mk
My interpretation, given that the directory does exist when the extract has
finished, is that the parent component (extracttar) is finishing before
it''s
child ( exec { "extracttar-$name"}) has finished extracting the file
(which
I hadn''t expected to occur). The termination of extracttar then invokes
the
''go'' signal to the sedfile component. What am I doing wrong as
this is
clearly something someone has experienced before and how can I fix it?
I''m runing puppet v0.22.1
Thanks,
Andrew
_______________________________________________
Puppet-users mailing list
Puppet-users@madstop.com
https://mail.madstop.com/mailman/listinfo/puppet-users