On Wed, Apr 23, 2014 at 8:54 AM, jcbollinger <john.bollin...@stjude.org> wrote:
>
>
> On Tuesday, April 22, 2014 2:16:22 PM UTC-5, Jon Forrest wrote:
>>
>> (I found a discussion from 6/22/09 on this topic, but that was a long time
>> ago.)
>
> Did the discussion give you reason to think that the behavior was
> unintentional or likely to change?

I didn't think that whatever my reaction was to a 5 year old discussion
would matter now.  Puppet changes. People change.

>> Using Puppet 3.5.1 on CentOS 6.5 I recently created the following:
>>
>>   package {
>>     [ "PackageKit"]:
>>       ensure => absent,
>>   }
>>
>> However, when I ran Puppet, I got
>>
>> Error: Execution of '/bin/rpm -e PackageKit-0.5.8-21.el6.x86_64' returned
>> 1: error: Failed dependencies:
>>         PackageKit = 0.5.8-21.el6 is needed by (installed)
>> PackageKit-yum-0.5.8-21.el6.x86_64
>>         PackageKit = 0.5.8-21.el6 is needed by (installed)
>> PackageKit-glib-0.5.8-21.el6.x86_64
>>         PackageKit is needed by (installed)
>> PackageKit-yum-plugin-0.5.8-21.el6.x86_64
>>
>> Notice that the provider is running '/bin/rpm' which explains the errors.
>
>
>
> Yes, this is intentional.  Puppet is taking care to avoid undeclared side
> effects.  Such side effects can make your manifest set inconsistent in ways
> that Puppet cannot otherwise detect.  For example, suppose somewhere else in
> your manifest set you had
>
>   package { "PackageKit-yum": ensure => 'installed' }
>
> That declaration and your example declaration are not consistent with each
> other, but if Puppet provided for ensure => absent via yum then both could
> be applied without error.  The result would depend on the relative order in
> which the declarations were applied, but neither result would be fully
> consistent with the catalog.

OK. See below.

>>
>> So, I explicitly added
>> a provider, so that the resource definition is this:
>>
>>  package {
>>     [ "PackageKit"]:
>>       provider => 'yum',
>>       ensure => absent,
>>   }
>>
>> There was no change!!
>>
>
>
> No, because the agent was selecting the yum provider already.  The yum
> provider ensures absent by use of 'rpm -e'.  Again, this is intentional.

Apparently. But still, I was hoping there would be a way to somehow express
that I really truly wanted yum to remove a package, the same way it would
if I ran yum on the command line. In this case, there are no
conflicting resource
definitions so there would be no problem with the catalog being consistent.

My perhaps naive assumption would be that if I explicitly used the 'yum'
provider Puppet would follow my direction. I'm clearly wrong. Again,
see below.

>> In the discussion from 2009, somebody suggested using "purge" instead of
>> "absent",
>> so I did.
>
> And if you are willing to accept the risk of inconsistency described above,
> then that is what you should do.  But it's spelled "purged", not "purge".

Oops. You're right. My mistake, although would it be reasonable to expect
Puppet to show an error?

So, apart from my stupid syntax error, it seems like my problem was caused
by not understanding the difference between "absent" and "purged" when
the "yum" provider is used. I just googled

"puppet difference between purged and absent"

and I didn't find an explanation. I also checked the Puppet Type
Reference manual
and I didn't find anything there. Can you point me to anything?

Thanks,
Jon Forrest

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

Reply via email to