On 28 January 2014 18:21, kaustubh chaudhari <kaustu...@gmail.com> wrote:
> Hi,
>
> How do we check if the package is installed, before installing it.
>
> I with to uninstall a package which i can do with ensure => absent, but
> before doing this, i would like to check if the package really exists on the
> system or not?
>
> Can someone help in here or redirect me to the correct documentation.
>

This isn't really how puppet works, but that's a good thing.

By saying absent you're not saying "uninstall this package" you're
saying "I want this package to be absent".

Therefore when you run the Puppet code with ensure => absent on a
system where the package isn't already installed it won't do anything,
the state is already as you have requested. Under the hood it will
check if the package is already installed - you don't have to do this
yourself.

Think of Puppet as describing the state you want, not as running a
series of commands and you'll write much better code.

Gareth

> -Kaustubh
>
> --
> 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/90e7a177-d567-4b7c-8fe7-cb30e06af0be%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Gareth Rushgrove
@garethr

devopsweekly.com
morethanseven.net
garethrushgrove.com

-- 
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/CAFi_6yLWRAssd0%3Dufe23VsWs67nC_vphHRf4CWMV0%2BzZGdS8Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to