summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-06-16 10:56:55 -0500
committerLuke Kanies <luke@madstop.com>2008-06-16 10:56:55 -0500
commit49016bb29312bfeb6f41ce420159e6ffc477eebe (patch)
tree7ce6fcf5f2c37519617915a3e79d487bdf5296ce
parent6b69a86e48be082a6d03ce69f2700c4c874e222f (diff)
parent5273b22b4fda6f9aa7a8366a1dfbae092594d391 (diff)
downloadpuppet-49016bb29312bfeb6f41ce420159e6ffc477eebe.tar.gz
puppet-49016bb29312bfeb6f41ce420159e6ffc477eebe.tar.xz
puppet-49016bb29312bfeb6f41ce420159e6ffc477eebe.zip
Merge branch '0.24.x'
Conflicts: CHANGELOG lib/puppet/defaults.rb spec/integration/defaults.rb
-rw-r--r--CHANGELOG9
-rw-r--r--lib/puppet/defaults.rb8
-rwxr-xr-xspec/integration/defaults.rb10
3 files changed, 23 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2f9a7a11b..a067ea712 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,10 @@
0.24.?
Removed support for the 'node_name' setting in LDAP and external node lookups.
+
+ Removed support for the 'node_name' setting in LDAP and external node
+ lookups.
+
Also removed support for 'default' nodes in external nodes.
LDAP nodes now use the certificate name, the short name, and 'default',
but external nodes just use the certificate name and any custom terminus
@@ -16,6 +20,11 @@
Fixed #1201 - all external node attributes are converted to strings.
+ Fixing #1168 (for 0.24.x) -- automatically downcasing the fqdn.
+ Also requiring that passed in certnames be downcased; the setting
+ system isn't currently flexible enough to automatically downcase
+ it for the user.
+
Adding a ResourceTemplate class for using templates directly
within resources (i.e., client-side templates). This would really
only be used for composite resources that pass the results of the
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index d77ec0486..fb4d67a91 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -167,8 +167,12 @@ module Puppet
end
Puppet.setdefaults(:main,
- :certname => [fqdn, "The name to use when handling certificates. Defaults
- to the fully qualified domain name."],
+ # We have to downcase the fqdn, because the current ssl stuff (as oppsed to in master) doesn't have good facilities for
+ # manipulating naming.
+ :certname => {:default => fqdn.downcase, :desc => "The name to use when handling certificates. Defaults
+ to the fully qualified domain name.",
+ :call_on_define => true, # Call our hook with the default value, so we're always downcased
+ :hook => proc { |value| raise(ArgumentError, "Certificate names must be lower case; see #1168") unless value == value.downcase }},
:certdnsnames => ['', "The DNS names on the Server certificate as a colon-separated list.
If it's anything other than an empty string, it will be used as an alias in the created
certificate. By default, only the server gets an alias set up, and only for 'puppet'."],
diff --git a/spec/integration/defaults.rb b/spec/integration/defaults.rb
index b6f6bf109..9d8ea30f7 100755
--- a/spec/integration/defaults.rb
+++ b/spec/integration/defaults.rb
@@ -6,7 +6,8 @@ require 'puppet/defaults'
describe "Puppet defaults" do
after { Puppet.settings.clear }
- describe "when configuring the :crl" do
+
+ describe "when setting the :factpath" do
it "should add the :factpath to Facter's search paths" do
Facter.expects(:search).with("/my/fact/path")
@@ -14,8 +15,13 @@ describe "Puppet defaults" do
end
end
- describe "when setting the :factpath" do
+ describe "when setting the :certname" do
+ it "should fail if the certname is not downcased" do
+ lambda { Puppet.settings[:certname] = "Host.Domain.Com" }.should raise_error(ArgumentError)
+ end
+ end
+ describe "when configuring the :crl" do
it "should warn if :cacrl is set to false" do
Puppet.expects(:warning)
Puppet.settings[:cacrl] = 'false'