On Friday, February 8, 2013 3:20:33 AM UTC-6, jim wrote:
>
> Hello Josh
>
> Thanks for reply so quickly, here is my manifest, thinking about it, I 
> assume it because i'm installing the agent every time, do I need to do 
> something like if service doesn't exist install else ignore ?
>
> regards
>
> James
>
> file { 'C:/Installs/check-mk-agent-1.2.1i5.exe':
> source               => 
> 'puppet:///modules/base/check-mk-agent-1.2.1i5.exe',
> mode                 => '0770',
> owner                => 'SYSTEM',
> group                => 'Administrators',
> } ->
>
> exec { 'Check_MK_Agent':
> command              => 'C:/Installs/check-mk-agent-1.2.1i5.exe /S',
> } ~>
>
> service { 'Check_MK_Agent':
> ensure               => 'running',
> enable               => true,
> require              => exec['Check_MK_Agent'],
> }
>
>
It is because the Exec runs every time and has a signaling relationship 
(designated by ~>)  with the service.  (And note that the Service's 
'require' of the Exec is redundant.)  An Exec changes state from "not run" 
to "run" when its command is successfully executed, and that triggers an 
event to be dispatched to any listeners.  Services restart if they receive 
events, which Puppet by default implements by stopping and then starting 
the service.

The best approach would probably be to package the install program and 
anything else associated with the service into an installable package (i.e. 
an .msi file) and have the Service depend on the package instead of 
directly on the installer program.  If that's not feasible, then you can 
use one or more of the Exec's 'onlyif', 'unless', and 'creates' parameters 
to instruct it whether it should execute the main command on any given 
catalog run.


John

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