Puppet: System Administration Automated

Support

Ticket #981 (new defect)

Opened 1 year ago

Last modified 9 months ago

info message about adding aliases repeated on every run

Reported by: marthag Assigned to: luke
Priority: normal Milestone:
Component: RAL Version: 0.24.1
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Attached Patches: Code Complexity: Trivial

Description (Last modified by DavidS)

Every time puppet is run, it sends an info message about adding aliases to every host with an alias. This happens even when the alias already exists, but should only happen the first time.

puppettest:~# grep example /etc/hosts
puppettest:~# puppet -v /tmp/test.pp
info: Loading fact virtual
info: Loading fact kernelversion
info: /Host[test.example.com]: Adding aliases "test"
notice: /Host[test.example.com]/ensure: created
info: Filebucket[/var/lib/puppet/clientbucket]: Adding /etc/hosts(91412413d215f23fab736c74e22ef2e4)
puppettest:~# grep example /etc/hosts
10.0.0.1        test.example.com        test
puppettest:~# puppet -v /tmp/test.pp
info: Loading fact virtual
info: Loading fact kernelversion
info: /Host[test.example.com]: Adding aliases "test"
puppettest:~# grep example /etc/hosts
10.0.0.1        test.example.com        test
puppettest:~# puppet -v /tmp/test.pp
info: Loading fact virtual
info: Loading fact kernelversion
info: /Host[test.example.com]: Adding aliases "test"
puppettest:~# cat /tmp/test.pp
host { "test.example.com" :
  ip     => "10.0.0.1",
  alias  => "test",
  ensure => present,
}

Attachments

aliases.diff (0.8 kB) - added by marthag on 01/02/08 17:51:05.
aliases.patch (0.5 kB) - added by marthag on 01/06/08 17:01:01.

Change History

01/02/08 17:51:05 changed by marthag

  • attachment aliases.diff added.

01/06/08 05:15:18 changed by jamtur01

  • stage changed from Unreviewed to Needs more info.

Patch is empty?

01/06/08 16:27:46 changed by marthag

  • stage changed from Needs more info to Unreviewed.

If you download the patch, you can see it, I don't know why it doesn't show correctly in the web interface. Here is:

--- lib/puppet/metatype/metaparams.rb 2008-01-02 18:22:41.000000000 +0200 +++ lib/puppet/metatype/metaparams.rb 2008-01-02 18:24:00.000000000 +0200 @@ -197,0 +197,0 @@

raise(Argument Error?, "Cannot add aliases without a catalog") unless @resource.catalog

- @resource.info "Adding aliases %s" % aliases.collect { |a| a.inspect }.join(", ") -

aliases.each do |other|

if obj = @resource.catalog.resource(@resource.class.name, other)

+ @resource.info "Adding aliases %s" % aliases.collect { |a| a.inspect }.join(", ")

unless obj.object_id == @resource.object_id

self.fail("%s can not create alias %s: object already exists" % [@resource.title, other])

end

01/06/08 17:01:01 changed by marthag

  • attachment aliases.patch added.

01/06/08 22:35:42 changed by jamtur01

  • owner changed from community to luke.
  • complexity changed from Unknown to Trivial.
  • stage changed from Unreviewed to Accepted.

I can replicate this - but don't think the patch is the right solution? Luke?

01/07/08 05:15:00 changed by luke

Hmm, I thought I knew what the source of the problem was, but I only see the alias being added once (although I agree that the line appears twice).

I am only getting one statement when using the stand-alone puppet, fwiw.

Does this patch make both log messages go away, or just one?

01/07/08 21:00:24 changed by marthag

With the patch I get a message on the first run, but not on the second run:

# puppet -v /tmp/test2.pp
info: Loading fact kernelversion
info: Loading fact virtual
notice: //Host[test.example.com]/ensure: created
info: Filebucket[/var/lib/puppet/clientbucket]: Adding /etc/hosts(27d8d04be9a1791c5fb6657df46efc57)
# puppet -v /tmp/test2.pp
info: Loading fact kernelversion
info: Loading fact virtual
colosseum9:~# cat /tmp/test2.pp
host { "test.example.com" :
  ip => "10.0.0.1", alias => "test", ensure => present,
}
# grep test /etc/hosts
10.0.0.1        test.example.com        test
#



01/11/08 11:41:56 changed by DavidS

  • description changed.

fixed description quoting

04/24/08 07:10:07 changed by luke

  • component changed from library to RAL.