your module to see how you might have done it. It runs, it creates the
javapath and copies the file... but I get the same error that I get on my
modules... can I please ask how you made unzip work? I am on Ubuntu
10.4.1, and 2.6.4 (Puppet Enterprise 1.0).
err: /Stage[main]/Apache-maven-v3/Exec[install_maven_v3]/returns: change
from notrun to 0 failed: /bin/tar zxf
/usr/local/java/apache-maven-3.0.3-bin.tar.gz returned 2 instead of one of
[0] at /etc/puppetlabs/puppet/modules/apache-maven-v3/manifests/init.pp:18
On Monday, May 2, 2011 7:58:09 AM UTC-7, Edd Grant wrote:
Hi All,
I have defined the following module to untar/unzip and copy the Maven
distributable to a convenient location:
class apache-maven-v3 {
exec { "/bin/tar xzf /etc/puppet/modules/apache-maven-v3/files/
apache-maven-3.0.3-bin.tar.gz":
cwd => "/usr/local/java",
creates => "/usr/local/java/apache-maven-3.0.3",
}
...
}
The above definition executes perfectly however in order to keep the
module portable I want to replace the absolute path to the .gz file
with a puppet:/// URI e.g.
exec { "/bin/tar xzf
puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz":
When I change the class to use the puppet:/// URI I get the following
error:
(/Stage[main]/Apache-maven-v3/Exec[/bin
/tar xzf
puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz]/return
s) change from notrun to 0 failed: /bin/tar xzf
puppet:///modules/apache-maven-v
3/apache-maven-3.0.3-bin.tar.gz returned 2 instead of one of [0] at /
etc/puppet/
modules/apache-maven-v3/manifests/init.pp:11
It appears to me that the puppet:/// URI is not being resolved in the
exec and this is causing the tar command to operate on the literal
path puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz
which of course doesn't exist.
Looking at the docs I can't see any examples of puppet:/// being used
in this way, is there anyway I can obtain the resolved absolute path
to pass this in to my exec? Failing that it there a standard approach
for combining a puppet:/// URI with an exec?
Cheers,
Edd
--Hi All,
I have defined the following module to untar/unzip and copy the Maven
distributable to a convenient location:
class apache-maven-v3 {
exec { "/bin/tar xzf /etc/puppet/modules/apache-maven-v3/files/
apache-maven-3.0.3-bin.tar.gz":
cwd => "/usr/local/java",
creates => "/usr/local/java/apache-maven-3.0.3",
}
...
}
The above definition executes perfectly however in order to keep the
module portable I want to replace the absolute path to the .gz file
with a puppet:/// URI e.g.
exec { "/bin/tar xzf
puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz":
When I change the class to use the puppet:/// URI I get the following
error:
(/Stage[main]/Apache-maven-v3/Exec[/bin
/tar xzf
puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz]/return
s) change from notrun to 0 failed: /bin/tar xzf
puppet:///modules/apache-maven-v
3/apache-maven-3.0.3-bin.tar.gz returned 2 instead of one of [0] at /
etc/puppet/
modules/apache-maven-v3/manifests/init.pp:11
It appears to me that the puppet:/// URI is not being resolved in the
exec and this is causing the tar command to operate on the literal
path puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz
which of course doesn't exist.
Looking at the docs I can't see any examples of puppet:/// being used
in this way, is there anyway I can obtain the resolved absolute path
to pass this in to my exec? Failing that it there a standard approach
for combining a puppet:/// URI with an exec?
Cheers,
Edd
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.