Issue #1798 has been updated by konrad rzentarzewski.

it's a pity that puppet can't do this and core team is only interested in 
patches.
we've got around it few years ago by not touching puppet, but rather parsing 
local catalog cache and comparing with chkconfig output.
it will work only with rh-like systems (ie. centos), but feel free to use it as 
workaround:

http://pastie.org/5383638
----------------------------------------
Bug #1798: Fix to allow resources {service: purge => true}...
https://projects.puppetlabs.com/issues/1798#change-76687

Author: Ido Rosen
Status: Re-opened
Priority: Normal
Assignee: Nigel Kersten
Category: 
Target version: 
Affected Puppet version: 0.24.6
Keywords: 
Branch: 


The service resource type needs an ensure => absent option so that it is 
compatible with purging of unmanaged entries.  Here's a patch to add an alias 
for it.  I've tested this patch.  In lieu of changing the way purging of 
unmanaged entries works, perhaps there should be a requirement that types 
support ensure => absent?

resources { service: purge => true } # will disable all services not explicitly 
enabled in your manifest after applying this patch, ensuring only the services 
you want running are indeed running...

Here's the patch:
<pre>
diff --recursive --unified puppet-0.24.6.orig/lib/puppet/type/service.rb 
puppet-0.24.6/lib/puppet/type/service.rb
--- puppet-0.24.6.orig/lib/puppet/type/service.rb       2008-07-08 
09:46:19.000000000 -0400
+++ puppet-0.24.6/lib/puppet/type/service.rb    2008-12-05 12:25:03.000000000 
-0500
@@ -64,6 +64,10 @@
             aliasvalue(:false, :stopped)
             aliasvalue(:true, :running)
 
+            # in order to make resources { service: purge => true } work 
+           # properly every type should support ensure => absent.
+            aliasvalue(:absent, :stopped)
+
             def retrieve
                 return provider.status
             end
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to