On Wed, Feb 13, 2013 at 3:53 AM, oliver zhang <oliver.x.zh...@gmail.com> wrote:
> Hi Everyone,
>
> I'm new to puppet.
>
> How do I do this in puppet:
>
> if process A is running, do nothing.
>
> else mount share and install package A
>
> I couldn't find any reference about this.
>
> Thanks.

In addition to what Paul says, the way that something like this would
normally be handled in Puppet is:

1) If process A is not running, start process A (this could be done via an Exec)
2) Step 1 may fail, because the binary used to launch process A is not
installed.  So, you'd also have a Package resource that would manage
the package that contains that binary.  At this point, the Exec can be
told to depend on the Package such that trying to start process A will
automatically trigger the installation of the necessary Package if
it's not already installed.
3) The Package (or particular configuration thereof) may require a
mount point to be available.  So, you'd also have a Mount resource
that would configure that mount point.  At this point, the Package
resource configured in step 2 can be told to depend on the Mount
resource such that installing the Package will automatically set up
and mount the Mount point resource.
4) Your node's manifest would only contain the Exec set up in step 1;
everything else will automatically be configured through the defined
dependency relationships.

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