Ticket #1133: puppet_node_name.diff
| File puppet_node_name.diff, 2.3 kB (added by johnf, 9 months ago) |
|---|
-
a/lib/puppet/defaults.rb
old new 327 327 :masterport => [8140, "Which port puppetmasterd listens on."], 328 328 :parseonly => [false, "Just check the syntax of the manifests."], 329 329 :node_name => ["cert", "How the puppetmaster determines the client's identity 330 and sets the 'hostname' fact for use in the manifest, in particular331 for determining which 'node' statement applies to the client.330 and sets the 'hostname', 'fqdn' and 'domain' facts for use in the manifest, 331 in particular for determining which 'node' statement applies to the client. 332 332 Possible values are 'cert' (use the subject's CN in the client's 333 333 certificate) and 'facter' (use the hostname that the client 334 334 reported in its facts)"], -
a/lib/puppet/network/handler/master.rb
old new 81 81 clientip = facts["ipaddress"] 82 82 if Puppet[:node_name] == 'cert' 83 83 if name 84 facts["fqdn"] = client 85 facts["hostname"], facts["domain"] = client.split('.', 2) 84 86 client = name 85 87 end 86 88 if ip -
a/test/network/handler/master.rb
old new 76 76 Puppet[:node_name] = "cert" 77 77 78 78 # Make sure we get the fact data back when nothing is set 79 facts = {"hostname" => "fact_hostname", "ipaddress" => "fact_ip"} 80 certname = "cert_hostname" 79 facts = { 80 "hostname" => "fact_hostname", 81 "domain" => "fact_domain", 82 "fqdn" => "fact_hostname.fact_domain", 83 "ipaddress" => "fact_ip" 84 } 85 certhostname = "cert_hostname" 86 certdomain = "cert_domain" 87 certname = certhostname + "." + certdomain 81 88 certip = "cert_ip" 82 89 83 90 resname, resip = master.send(:clientname, nil, nil, facts)