Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
PUP 3.4.3
-
3
-
Client 2015-09-16, Client 2015-09-30, Client 2015-10-14, Client 2015-10-28, Client 2015-11-11
-
Bug Fix
-
Resources created by another type (via the `generate` method) will now have any relationship metaparams respected, and will participate in `autorequire`
Description
I've preserved the original description below for posterity. Note however that this issue is now tracking only the first (of two) issues described in the original problem report.
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.
Attachments
Issue Links
- blocks
-
MODULES-1341 firewall with purge=>true fails when first run with firewalld installed and iptables-service not installed
-
- Resolved
-
- is duplicated by
-
PDB-134 Purging resources that were exported resources sometimes fails
-
- Closed
-
- relates to
-
PUP-4748 Allow resources to be purged even when they have dependency relationships
-
- Closed
-
-
PUP-5447 Warning for dependency conflict with purging should specify conflicting resource
-
- Closed
-
-
MODULES-3030 Firewall module not purging unmanaged rules
-
- Closed
-
-
PUP-1153 Incorrect ordering of group and user resource purging
-
- Closed
-
- clones