Issue #8757 has been updated by Matt Dainty.
Additionally for my example, the first alias that appears in the file that
would be purged does not get purged while the resources resource has a notify
parameter, I get the following logged:
<pre>
warning: /Mailalias[bin]:
Whit[Completed_class[Postfix]],Whit[Completed_stage[main]],Exec[newaliases]
still depend on me -- not purging
</pre>
("bin" being the first/only alias I have in my aliases file that I want rid of,
and "postfix" being the containing class)
If I comment out the notify parameter then the last unwanted alias will be
removed.
----------------------------------------
Bug #8757: Resources type and metaparameters don't seem to work, specifically
notify.
https://projects.puppetlabs.com/issues/8757#change-59772
Author: Matt Pascoe
Status: Needs More Information
Priority: Normal
Assignee: Matt Pascoe
Category: metaparameters
Target version:
Affected Puppet version: 0.25.0
Keywords: resources purge a2mod apache
Branch:
First off I will quickly explain what it is I'm trying to do. I have installed
the puppetlabs-apache-0.0.3 module that provides a new type called a2mod. My
goal is to use virtual resources to collect a list of modules to enable/disable
on a node. I would also however, like to ensure that all other apache modules
are disabled on the system. I found the resources type has a purge option. I
then updated the provider to have an instances section since it did not have
one. It looks like this:
class << self
attr_accessor :defpath
end
@defpath = "/etc/apache2/mods-available/"
def self.instances
self.defpath = [self.defpath] unless self.defpath.is_a? Array
instances = []
self.defpath.each do |path|
unless FileTest.directory?(path)
Puppet.debug "Apache module path %s does not exist" % path
next
end
check = [:ensure]
if public_method_defined? :enabled?
check << :enable
end
Dir.entries(path).each do |name|
if name =~ /.load/
name = name.sub(".load","")
instances << new(:name => name, :path => path)
end
end
end
instances
end
I then used the resources type to purge out unused apache modules. This
seemingly does the job I wanted it to do. However, I wanted to notify my
apache to restart if it had disabled any modules. I added the notify
metaparameter to the configuration but it would never notify.
resources { 'a2mod': tag => 'modtest', notify => Exec['apache2reload'],
purge => true, loglevel => 'notice' }
I then tried to add a tag for testing purposes and it would not see the tag
being set. I could however use loglevel but it would seem other metaparameters
would not work properly. I'm assuming that all parameters on
http://docs.puppetlabs.com/references/stable/metaparameter.html should be
available to the resources type as indicated by the documentation for the
resources type.
So, I'm wanting to understand if "all" metaparameters should work with the
resources type or not. And, is there any possible way to do a purge that would
allow me to do a notify of another resource.
--
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.