On Wed, Jan 30, 2013 at 8:24 AM, yarlagadda ramya <rams.15...@gmail.com> wrote:

> $software = "/app/tcs/puppetdemo/software"
> $server = "/app/tcs/puppetdemo/server"
> $URL = "http://192.168.24.171:8080/softwares/jboss-as-7.1.1.Final.tar.gz";
>
> exec{"/usr/bin/wget $URL":
> cwd =>"$software",
> }
>
> exec{"/bin/chmod -R 0775 /app/tcs/puppetdemo/software/":
> }
>
> exec {"/bin/tar -C /app/tcs/puppetdemo/server/ -zxf
> /app/tcs/puppetdemo/software/jboss-as-7.1.1.Final.tar.gz":
> }
>
> But here the untaring exec command i.e.,the 3rd exec is executing first and
> throwing an error..as that particular tar file is not there for untaring and
> then the first exec that is downloading the tar file is happening. I want
> all the steps to happen in an order i.e., Downloading>>Changing
> permission>>copying>>untarring.
>
> Can any body please help me with this.

It looks like you are under the impression that your manifest will be
executed in the order that you write it.

However, that is not the case.  Puppet will apply the
classes/resources in any order it wants to, unless explicitly told
that there is a relationship between them.

I can highly recommend the PuppetLabs documentation, in particular the
'Learning Puppet' guide, which is a nice walkthrough for new users
(http://docs.puppetlabs.com/learning/).  In particular, 'Ordering' at
http://docs.puppetlabs.com/learning/ordering.html.

In the short term though, this should fix your current manifests:

$software = "/app/tcs/puppetdemo/software"
$server = "/app/tcs/puppetdemo/server"
$URL = "http://192.168.24.171:8080/softwares/jboss-as-7.1.1.Final.tar.gz";

exec{"/usr/bin/wget $URL":
cwd =>"$software",
}

exec{"/bin/chmod -R 0775 /app/tcs/puppetdemo/software/":
  require => Exec["/usr/bin/wget $URL"]
}

exec {"/bin/tar -C /app/tcs/puppetdemo/server/ -zxf
/app/tcs/puppetdemo/software/jboss-as-7.1.1.Final.tar.gz":
  require => Exec["/bin/chmod -R 0775 /app/tcs/puppetdemo/software/"
}

There are potentially better ways of getting the jboss tarball into
your target directory with the correct permissions, meaning that those
exec's aren't required in the first place.  See the documentation on
the File resource at
http://docs.puppetlabs.com/references/3.0.latest/type.html#file.

Regards,

Matt.

-- 
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+unsubscr...@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to