Issue #7624 has been updated by Luke Kanies.
This patch seems to work:
<pre>
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index 1dbf124..195b09e 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -876,6 +876,12 @@ class Type
# Put the default provider first, then the rest of the suitable providers.
provider_instances = {}
providers_by_source.collect do |provider|
+ all_properties = self.properties.find_all do |property|
+ provider.supports_parameter?(property)
+ end.collect do |property|
+ property.name
+ end
+
provider.instances.collect do |instance|
# We always want to use the "first" provider instance we find, unless
the resource
# is already managed and has a different provider set
@@ -886,7 +892,10 @@ class Type
end
provider_instances[instance.name] = instance
- new(:name => instance.name, :provider => instance, :audit => :all)
+ result = new(:name => instance.name, :provider => instance)
+ properties.each { |name| result.newattr(name) }
+ result
end
end.flatten.compact
end
</pre>
With this applied I get all properties listed when I run 'ralsh user' or
equivalent. The key is that 'audit' (in the 'munge' method for the audit
parameter) creates a property instance for every audited property. I've just
replaced that functionality with this patch.
----------------------------------------
Bug #7624: resource purging causes audit messages
https://projects.puppetlabs.com/issues/7624
Author: Dan Bode
Status: Code Insufficient
Priority: High
Assignee: Nigel Kersten
Category:
Target version: 2.7.0
Affected Puppet version: 2.6.5
Keywords:
Branch: https://github.com/bodepd/puppet/tree/issue/2.6.next/7624
Given the code:
<pre>
resources { 'host':
purge => true
}
host { 'foo':
ip => '127.0.0.2'
}
</pre>
when removing state yaml and running puppet apply it logs several audit events:
<pre>
rm /var/lib/puppet/state/state.yaml
# puppet apply tests/limits.pp --noop
notice: /Host[foop]/ensure: current_value present, should be absent (noop)
notice: /Host[foop]/ensure: audit change: newly-recorded value present
notice: /Host[foop]/ip: audit change: newly-recorded value 127.0.0.2
notice: /Host[foop]/host_aliases: audit change: newly-recorded value absent
notice: /Host[foop]/comment: audit change: newly-recorded value
notice: /Host[foop]/target: audit change: newly-recorded value /etc/hosts
notice: /Host[danshost]/ensure: current_value present, should be absent (noop)
notice: /Host[danshost]/ensure: audit change: newly-recorded value present
notice: /Host[danshost]/ip: audit change: newly-recorded value 127.0.0.2
notice: /Host[danshost]/host_aliases: audit change: newly-recorded value absent
notice: /Host[danshost]/comment: audit change: newly-recorded value
notice: /Host[danshost]/target: audit change: newly-recorded value /etc/hosts
notice: /Host[localhost6.localdomain6]/ensure: current_value present, should be
absent (noop)
notice: /Host[localhost6.localdomain6]/ensure: audit change: newly-recorded
value present
notice: /Host[localhost6.localdomain6]/ip: audit change: newly-recorded value
::1
notice: /Host[localhost6.localdomain6]/host_aliases: audit change:
newly-recorded value localhost6
notice: /Host[localhost6.localdomain6]/comment: audit change: newly-recorded
value
notice: /Host[localhost6.localdomain6]/target: audit change: newly-recorded
value /etc/hosts
notice: /Host[localhost.localdomain]/ensure: current_value present, should be
absent (noop)
notice: /Host[localhost.localdomain]/ensure: audit change: newly-recorded value
present
notice: /Host[localhost.localdomain]/ip: audit change: newly-recorded value
127.0.0.1
notice: /Host[localhost.localdomain]/host_aliases: audit change: newly-recorded
value
localhostpuppetmasterpuppetagentpuppetmaster.localdomainpuppetagent.localdomainpuppet
notice: /Host[localhost.localdomain]/comment: audit change: newly-recorded
value
notice: /Host[localhost.localdomain]/target: audit change: newly-recorded value
/etc/hosts
notice: Finished catalog run in 0.06 seconds
</pre>
I have verified that this exists in both 2.7.0rc3, 2.6.8, and 2.6.5,
it does not occur in 2.6.4 (which is consistent with #6443)
--
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.