Hi John,

I totally agree with you and i am trying to do the same cleaning previous
crap!

Thanks a ton for your advice. I created a custom fact and did simple if ..
else which did the job!

Have a great day ahead!


With Warm Regards
Kaustubh.A.Chaudhari
(M)-09373102619


On Wed, Mar 5, 2014 at 1:20 PM, jcbollinger <john.bollin...@stjude.org>wrote:

>
>
> 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 a topic in the
> Google Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/MsyNFxZ4atE/unsubscribe.
> To unsubscribe from this group and all its topics, 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<https://groups.google.com/d/msgid/puppet-users/88fd0a27-1ffa-4e7a-8a9f-9961b70cbba2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAGceKKot9KHqbbcv7fBc6socMmDqSWzdAmOV7ZgwHgJbGp68GA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to