On Wednesday, March 5, 2014 9:40:48 AM UTC-6, kaustubh chaudhari wrote:
>
> Hi All,
>
> I need to check if a service or a package is already installed before 
> running the further code.
>
> Eg:
>
> Install bigfix package if bigfix service dose not exist.
>
> i know ensure => true will do this, but there is a possibility that bigfix 
> was installed from the source in c:\bigfix on few server and on few its 
> installed as a msi and i can see it under add remove programs.
>
> So the best way is to check if the bigfix service exists or not, if exist 
> ignore if not install via puppet.
>
> Any pointers ?
>
>

The way to inform the Puppet master about the state of the target system 
before catalog compilation is via facts.  You can create a custom fact that 
uses whatever logic is appropriate to determine whether the software in 
question is installed, and then use conditionals based on that fact in your 
manifests to control whether you declare the Package or not.

But you shouldn't.  Bite the bullet: bring your servers under control so 
that this sort of thing is no longer a concern.  It is really bad to 
install software from source on your production machines.  Everything ought 
to be managed via packages.

If needs be you could adopt a hybrid approach: write a custom fact that 
identifies when a piece of software of interest is installed from source, 
and when that's so, tell Puppet to remove it before (re)installing it from 
a package (e.g. an MSI).  The package then does not need to be conditional, 
which is to your advantage if you ever want to use Puppet to update it or 
remove it.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/88fd0a27-1ffa-4e7a-8a9f-9961b70cbba2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to