diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-20 18:10:06 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-20 18:10:06 +0000 |
| commit | 46824cd8167e2d07ba1f1bdb0cc24789b3a565b1 (patch) | |
| tree | 17c71d0bcf72eed63652ffa2493a40f4302301b1 /lib/puppet/server | |
| parent | 15905bd5ee0d692e44bed516fe720c278ce67835 (diff) | |
| download | puppet-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/puppet/server')
| -rw-r--r-- | lib/puppet/server/ca.rb | 27 |
1 files changed, 19 insertions, 8 deletions
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 |
