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.

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.

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

Attachment: signature.asc
Description: Digital signature

Reply via email to