Project

General

Profile

Bug #2693

unattended installation without Puppet CA is failing

Added by Michael Moll about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Unattended installations
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Unattended installations work very well in my environment... Today a collegue forgot to select the Puppet master and Puppet CA while provivisoning a new host.

While I could preview /unattended/provision?spoof=<ip> without problems, the client came across an internal server error:

Started GET "/unattended/provision?token=1771b184-6c0c-4789-8fc3-ee2b6f77495c" for 1.2.3.4 at Fri Jun 21 20:32:17 +0200 2013
Processing by UnattendedController#provision as HTML
  Parameters: {"token"=>"1771b184-6c0c-4789-8fc3-ee2b6f77495c"}
Found nasign.test.1234.de
  Rendered text template (0.0ms)
Filter chain halted as :handle_ca rendered or redirected
Completed 500 Internal Server Error in 8ms (Views: 0.5ms | ActiveRecord: 0.7ms)

Dominic said: "Sounds like an issue relating to when they were made optional"


Related issues

Related to Foreman - Bug #3541: ec2 provisioning failure in setSSHProvision (when no CA available?)Closed2013-10-29

Associated revisions

Revision f09d61de (diff)
Added by Dominic Cleal about 6 years ago

fixes #2693 - don't cause handle_ca error when no Puppet CA associated with host

Revision b27afff3 (diff)
Added by Dominic Cleal about 6 years ago

fixes #2693 - don't cause handle_ca error when no Puppet CA associated with host

(cherry picked from commit f09d61de451450a566c7ee16bdf35281e98708c4)

History

#1 Updated by Ohad Levy about 6 years ago

looking at the code, the only way it would not raise that error would be if you set manage_puppetca setting to false.

a simple solution could be:


diff --git a/app/models/host/managed.rb b/app/models/host/managed.rb
index cb3d468..8950920 100644
--- a/app/models/host/managed.rb
+++ b/app/models/host/managed.rb
@@ -223,9 +223,8 @@ class Host::Managed < Host::Base
   def handle_ca
     return true if Rails.env == "test" 
     return true unless Setting[:manage_puppetca]
-    if puppetca?
-      respond_to?(:initialize_puppetca,true) && initialize_puppetca && delCertificate && setAutosign
-    end
+    return true unless puppetca?
+    respond_to?(:initialize_puppetca,true) && initialize_puppetca && delCertificate && setAutosign
   end

#2 Updated by Dominic Cleal about 6 years ago

  • Target version deleted (1.2.0)

#3 Updated by Dominic Cleal about 6 years ago

  • Target version set to 1.2.1

#4 Updated by Dominic Cleal about 6 years ago

  • Priority changed from Normal to High

#5 Updated by Dominic Cleal about 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal

#6 Updated by Michael Moll about 6 years ago

The patch seems to help:

Started GET "/unattended/provision?token=401a421e-6c98-4af9-bf35-e8d8cb292c0c" for x.x.x.x at Mon Jul 22 17:29:44 +0200 2013
Processing by UnattendedController#provision as */*
  Parameters: {"token"=>"401a421e-6c98-4af9-bf35-e8d8cb292c0c"}
Found catest.test.xxx.de
  Rendered inline template (30.9ms)
Completed 200 OK in 73ms (Views: 31.3ms | ActiveRecord: 4.4ms)

#7 Updated by Dominic Cleal about 6 years ago

Thanks for testing!

#8 Updated by Dominic Cleal about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#9 Updated by Dominic Cleal almost 6 years ago

  • Related to Bug #3541: ec2 provisioning failure in setSSHProvision (when no CA available?) added

Also available in: Atom PDF