summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-20 18:10:06 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-20 18:10:06 +0000
commit46824cd8167e2d07ba1f1bdb0cc24789b3a565b1 (patch)
tree17c71d0bcf72eed63652ffa2493a40f4302301b1 /lib
parent15905bd5ee0d692e44bed516fe720c278ce67835 (diff)
downloadpuppet-46824cd8167e2d07ba1f1bdb0cc24789b3a565b1.tar.gz
puppet-46824cd8167e2d07ba1f1bdb0cc24789b3a565b1.tar.xz
puppet-46824cd8167e2d07ba1f1bdb0cc24789b3a565b1.zip
Setting pluginsync default to false, and (hopefully) fixing autosign problem when the file exists and autosign is set to true (#180). The problem was that the puppetmasterd script was redundantly setting autosign in the CA, when the CA already knows how to deal with autosigning, which meant that autosign was being set before the config was parsed. Thus, there was no bug when autosign was set on the command line but there was when it was set in the config.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1304 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/client/master.rb2
-rw-r--r--lib/puppet/server/ca.rb27
2 files changed, 20 insertions, 9 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb
index cadabe33b..70037729f 100644
--- a/lib/puppet/client/master.rb
+++ b/lib/puppet/client/master.rb
@@ -27,7 +27,7 @@ class Puppet::Client::MasterClient < Puppet::Client
"From where to retrieve plugins. The standard Puppet ``file`` type
is used for retrieval, so anything that is a valid file source can
be used here."],
- :pluginsync => [true,
+ :pluginsync => [false,
"Whether plugins should be synced with the central server."]
)
diff --git a/lib/puppet/server/ca.rb b/lib/puppet/server/ca.rb
index 5c2d739b1..0aa31d937 100644
--- a/lib/puppet/server/ca.rb
+++ b/lib/puppet/server/ca.rb
@@ -16,28 +16,36 @@ class Server
iface.add_method("array getcert(csr)")
}
+ def autosign
+ if defined? @autosign
+ @autosign
+ else
+ Puppet[:autosign]
+ end
+ end
+
# FIXME autosign? should probably accept both hostnames and IP addresses
def autosign?(hostname)
# simple values are easy
- if @autosign == true or @autosign == false
- return @autosign
+ if autosign == true or autosign == false
+ return autosign
end
# we only otherwise know how to handle files
- unless @autosign =~ /^\//
+ unless autosign =~ /^\//
raise Puppet::Error, "Invalid autosign value %s" %
- @autosign.inspect
+ autosign.inspect
end
- unless FileTest.exists?(@autosign)
+ unless FileTest.exists?(autosign)
unless defined? @@warnedonautosign
@@warnedonautosign = true
- Puppet.info "Autosign is enabled but %s is missing" % @autosign
+ Puppet.info "Autosign is enabled but %s is missing" % autosign
end
return false
end
auth = Puppet::Server::AuthStore.new
- File.open(@autosign) { |f|
+ File.open(autosign) { |f|
f.each { |line|
auth.allow(line.chomp)
}
@@ -49,7 +57,10 @@ class Server
def initialize(hash = {})
Puppet.config.use(:puppet, :certificates, :ca)
- @autosign = hash[:autosign] || Puppet[:autosign]
+ if hash.include? :autosign
+ @autosign = hash[:autosign]
+ end
+
@ca = Puppet::SSLCertificates::CA.new(hash)
end