On 13 February 2013 19:41, Matthias Viehweger
<m.viehwe...@heute-kaufen.de>wrote:

> Hi Oliver!
>
> On Tue, Feb 12, 2013 at 07:53:55PM -0800, oliver zhang wrote:
> > 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.
>
> I would first ensure that the process is running (assuming that it's a
> service). The service would require the package which would require the
> share to be mounted.
>

+1

I was just about to recommend doing it in a similar way.
It's not too tricky to make a service in linux if your application isn't
already one.

A rough outline would be:
>
>   service { 'A':
>     ensure => running,
>     require => Package['A'];
>   }
>
>   package { 'A':
>      ensure => installed,
>      require => Exec['mount share'];
>   }
>
>   exec { 'mount share':
>     command => '...',
>     if => command to check if not mounted;
>   }
>
> I may be wrong, of course, but this would be my first try to resolve
> this.
>

Nope not wrong at all.
I would probably recommend putting them in separate subclasses and then
using class chaining or require => Class[blah::service] etc
to make it easier to add new packages or services later but the theory is
the same.


> Cheers,
> Matthias
> --
> Serververwaltung und Softwareentwicklung
>
> https://www.heute-kaufen.de
> Prinzessinnenstraße 20 - 10969 Berlin
>

-- 
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