Bug #2949

host can be exported without ipaddress

Added by Dan Bode 9 months ago. Updated 9 months ago.

Status:Rejected Start:12/17/2009
Priority:Normal Due date:
Assignee:Dan Bode % Done:

0%

Category:-
Target version:0.25.2
Affected version:0.25.1 Branch:
Keywords:
Votes: 0

Description

the following puppet code works:

@@host { “$fqdn”:

       ensure => "present",
       alias => "$hostname",

}

puppet will happily store this host, despite the fact that ip address is a required parameter.

then on collection, you see the following error:

[root@dansRH1 manifests]# puppet collecthosts.pp —certname collect.test notice: //Host[dansRH1.localdomain]/ensure: created err: Got an uncaught exception of type ArgumentError: ip is a required attribute for hosts

I assume this would also occur with any resources that have required parameters, but I dont know of any others.

I am assuming that this is a bug (exports a bad resources which now causes an error on every host in the network)


Related issues

related to Puppet - Bug #2942: store configs error: After adding a new external node, al... Closed 12/16/2009
related to Puppet - Bug #2964: updated resources cannot be collected until they are expo... Closed 12/19/2009

History

Updated by Markus Roberts 9 months ago

  • Status changed from Unreviewed to Investigating
  • Target version set to 0.25.2

Updated by Markus Roberts 9 months ago

  • Status changed from Investigating to Needs more information
  • Assignee set to Dan Bode

Dan —

From what I can see, ip isn’t a required property of hosts. Are you saying it should be?

— Markus

Updated by Dan Bode 9 months ago

when combined with ensure => present, then ip is required. Note the error below.

[root@puppetclient ~]# puppet -e ‘host{'test1’: ensure=> present}‘ notice: //Host[test1]/ensure: created err: Got an uncaught exception of type ArgumentError: ip is a required attribute for hosts

Updated by Markus Roberts 9 months ago

So that’s a subtle distinction here (and the wording of the error message doesn’t help). An IP address is not a required property of a host resource—it isn’t needed to talk about a host, and in fact there are cases where you’d want to be able to talk about hosts by name without knowing their IP addresses. You could even verify the presence of a host without knowing its IP address. Only when you go to create one do you need the IP address.

The error you reported is a client side failure to apply the catalog, and only come at the end of the process after the puppetmaster has already compiled the catalog, sent it to the client, and the client has compared what should be with what is, decided that changes need to be made, and started making them. It’s not an objection to the catalog itself.

I don’t think this uniqe to hosts (other resources should present analogous situations) or is a change in behaviour either, though I could be mistaken.

Updated by Markus Roberts 9 months ago

  • Status changed from Needs more information to Rejected

Also available in: Atom PDF