Hey there, I''m trying to untar some archives puppet copied onto the clients before but the "untaring" always fails with: err: //allgemein::bigbrother/Exec[untar bb19c]/returns: change from notrun to 0 failed: tar -jxf ''bb19c.tar.bz2'' returned 2 instead of one of [0] at /etc/puppet/modules/allgemein/manifests/bigbrother.pp:22 If tar returns 2 it means that it could find the file to work with... This is an extract from my manifest: exec { "untar bb19c": command => "tar -jxf bb19c.tar.bz2", cwd => "/usr/local", path => "/bin", creates => "/usr/local/bb19c", require => File["/usr/local/bb19c.tar.bz2"], before => File["/usr/local/bb"] } This problem occurs with other untar-exec-types too while other exec- types work fine. If I execute the command via command line everything is fine. I''m runnig puppet v 0.25.4 Christian -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Tuesday 29 June 2010, ext Christian Casar wrote:> Hey there, > > I''m trying to untar some archives puppet copied onto the clients > before but the "untaring" always fails with: > > err: //allgemein::bigbrother/Exec[untar bb19c]/returns: change > from notrun to 0 failed: tar -jxf ''bb19c.tar.bz2'' returned 2 > instead of one of [0] at > /etc/puppet/modules/allgemein/manifests/bigbrother.pp:22Is this copy-pasted verbatim? Because those single quotes around bb19c.tar.bz2 look suspicious, considering you didn''t ask for them in your puppet config. -- Rohan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
> Is this copy-pasted verbatim? Because those single quotes around > bb19c.tar.bz2 look suspicious, considering you didn''t ask for them > in your puppet config.The single qoutes are a relict from my different approaches to solve the problem... With and without them the same error occurs: err: //allgemein::bigbrother/Exec[untar bb19c]/returns: change from notrun to 0 failed: tar -jxf bb19c.tar.bz2 returned 2 instead of one of [0] at /etc/puppet/modules/allgemein/manifests/bigbrother.pp:22 My guess is that puppet executes tar from the from directory but commands like "cd /usr/local && tar -jxf bb19c.tar.bz2" or "tar -jxf /usr/local/bb19c.tar.bz2" also return that error... On 29 Jun., 09:53, Rohan McGovern <rohan.mcgov...@nokia.com> wrote:> On Tuesday 29 June 2010, ext Christian Casar wrote: > > > Hey there, > > > I''m trying to untar some archives puppet copied onto the clients > > before but the "untaring" always fails with: > > > err: //allgemein::bigbrother/Exec[untar bb19c]/returns: change > > from notrun to 0 failed: tar -jxf ''bb19c.tar.bz2'' returned 2 > > instead of one of [0] at > > /etc/puppet/modules/allgemein/manifests/bigbrother.pp:22 > > Is this copy-pasted verbatim? Because those single quotes around > bb19c.tar.bz2 look suspicious, considering you didn''t ask for them > in your puppet config. > > -- > Rohan-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Tuesday 29 June 2010, ext Christian Casar wrote:> > Is this copy-pasted verbatim? Because those single quotes > > around bb19c.tar.bz2 look suspicious, considering you didn''t > > ask for them in your puppet config. > > The single qoutes are a relict from my different approaches to > solve the problem...OK. When you show logs and puppet config in the future, could you please make sure they match? :-) I''m not trying to be pedantic, but little details like this can matter. I notice in your puppet config you set path to "/bin". Since you''re unzipping a bzipped tarball, tar probably needs to run the `bzip2'' command. But, at least on my system, that''s in /usr/bin, not /bin. Find out where the bzip2 command is located and make sure that''s also in path. -- Rohan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Responses in-line.> The single qoutes are a relict from my different approaches to solve > the problem... > With and without them the same error occurs: > > err: //allgemein::bigbrother/Exec[untar bb19c]/returns: change from > notrun to 0 failed: tar -jxf bb19c.tar.bz2 returned 2 instead of one > of [0] at /etc/puppet/modules/allgemein/manifests/bigbrother.pp:22 >You want command => "/bin/tar -C $somedirectory -jxf /path/to/bb19x.tar.bz2, require => File["/path/to/bb19x.tar.bz2"]; or the require to whatever exec downloads that file.> My guess is that puppet executes tar from the from directory but > commands like > "cd /usr/local&& tar -jxf bb19c.tar.bz2" > or > "tar -jxf /usr/local/bb19c.tar.bz2" > also return that error... >cd is a shell built-in. Puppet uses exec functions in exec resources. To use shell built-ins you need to do something like: command => "/bin/bash -c ''pushd somedir && dosomething''", -- -- Joe McDonagh Operations Engineer AIM: YoosingYoonickz IRC: joe-mac on freenode "When the going gets weird, the weird turn pro." -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Thanks for all your help!> Since you''re unzipping a bzipped tarball, tar probably needs to run > the `bzip2'' command. But, at least on my system, that''s > in /usr/bin, not /bin. Find out where the bzip2 command is located > and make sure that''s also in path.That''s what finally solved my problem. I guess in the future I will always put root''s $PATH into any exec path... Christian On 30 Jun., 01:43, Joe McDonagh <joseph.e.mcdon...@gmail.com> wrote:> Responses in-line.> The single qoutes are a relict from my different approaches to solve > > the problem... > > With and without them the same error occurs: > > > err: //allgemein::bigbrother/Exec[untar bb19c]/returns: change from > > notrun to 0 failed: tar -jxf bb19c.tar.bz2 returned 2 instead of one > > of [0] at /etc/puppet/modules/allgemein/manifests/bigbrother.pp:22 > > You want > > command => "/bin/tar -C $somedirectory -jxf /path/to/bb19x.tar.bz2, > require => File["/path/to/bb19x.tar.bz2"]; > > or the require to whatever exec downloads that file.> My guess is that puppet executes tar from the from directory but > > commands like > > "cd /usr/local&& tar -jxf bb19c.tar.bz2" > > or > > "tar -jxf /usr/local/bb19c.tar.bz2" > > also return that error... > > cd is a shell built-in. Puppet uses exec functions in exec resources. To > use shell built-ins you need to do something like: > > command => "/bin/bash -c ''pushd somedir && dosomething''", > > -- > -- > Joe McDonagh > Operations Engineer > AIM: YoosingYoonickz > IRC: joe-mac on freenode > "When the going gets weird, the weird turn pro."-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 30 June 2010 09:08, Christian Casar <c.casar@web.de> wrote:> I guess in the future I will always put root''s $PATH into any exec > path...Not every configuration directive needs to be specified either, IMHO - there are only a few systems where I specify a path and that''s usually to add important stuff in /usr/local or /opt. Most systems will get by just fine without you specifying it to Puppet at all. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.