Project

General

Profile

Actions

Bug #1737

closed

Reprovisioning of servers does not work with puppet facts in same DB

Added by Hannes Schaller almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hello!

I'm using 0.5-nightly-84fce85c running on activerecord 3.0.10 with a PostgresDB and Puppet 2.7.17.
Puppet and Foreman are sharing their database (of which I am not sure is still a "supported" way).

As Ohad wrote in IRC the standard to save MAC addresses in the DB is lowercase. Unfortunately Puppet passes it's facts (especially the mac address) without case transformation into the database (see https://github.com/puppetlabs/facter/blob/master/lib/facter/macaddress.rb#L16 ).
On Debian (and i guess Ubuntu) this isn't a problem as the macaddress is in lowercase.
On RedHat (tested all versions from 5.2 until 6.3) ifconfig outputs the Macaddress in uppercase letters.

I solved this problem by patching unattended_controller.rb:

diff --git a/app/controllers/unattended_controller.rb b/app/controllers/unattended_controller.rb
index f065ecf..082c7dd 100644
--- a/app/controllers/unattended_controller.rb
+++ b/app/controllers/unattended_controller.rb
@@ -99,6 +99,7 @@ class UnattendedController < ApplicationController
       begin
         request.env.keys.each do | header |
           maclist << request.env[header].split[1].downcase.strip if header =~ /^HTTP_X_RHN_PROVISIONING_MAC_/
+                 maclist << request.env[header].split[1].upcase.strip if header =~ /^HTTP_X_RHN_PROVISIONING_MAC_/
         end
       rescue => e
         logger.info "unknown RHN_PROVISIONING header #{e}" 


Maybe someone will come up with a better solution but it might help others for now :)

best wishes
Hannes

Actions #1

Updated by Ohad Levy almost 12 years ago

  • Target version set to 1.0
Actions #2

Updated by Ohad Levy almost 12 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF