Bug #1489
closed
AIX not showing up on Hosts page
Added by Jon Whited almost 13 years ago.
Updated over 6 years ago.
Category:
Unattended installations
|
Description
AIX is not showing up on the Hosts page in Foreman 0.4.1. If I look at the Facts view for this host, operatingsystem=AIX. However, I looked at the hosts table in the db and operatingsystem_id is null. Also, AIX does not
show up in the operatingsystems table in the db. yaml from facter --yaml from aix 6.1 is attached.
I have made an update to my facter to "correctly" set productname, manufacturer, serialnumber, and hardwaremodel. "Model" does show correctly on the Hosts page.
Thanks for taking a look.
Files
I did what someone else perhaps has done as a good workaround -- modify the facter fact for operatingsystemrelease since foreman is expecting major.minor
I added this to operatingsystemrelease.rb before the "catch-all" entry at the end.
Facter.add(:operatingsystemrelease) do
confine :operatingsystem => :aix
setcode 'oslevel | cut -c1-3'
end
Then AIX gets added to the database and it shows up correctly on the hosts and statistics pages.
Actually, I also had to create app/models/aix.rb. It would not work for provisioning, but it does the job otherwise:
class AIX < Operatingsystem
PXEFILES = {:kernel => "powerpc", :initrd => "initrd"}
# Override the class representation, as this breaks many rails helpers
def class
Operatingsystem
end
def pxe_type
"nim"
end
def pxedir
"boot/$arch/loader"
end
def url_for_boot(file)
pxedir + "/" + PXEFILES[file]
end
end
great job!
not 100% sure why would you need to add the Aix OS type, did you get any other errors without it?
and while we are at it, any chance you want to add an AIX icon? :)
Unfortunately, I'm not aware of any copyright free images for AIX. Otherwise, this is a nice one -- http://en.wikipedia.org/wiki/File:IBM-AIX_logo20080906.png :)
Yes, I did get an error without it:
The single-table inheritance mechanism failed to locate the subclass: 'AIX'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Operatingsystem.inheritance_column to use another column for that information.
Because we are using AIX i also added this to operatingsystems_helper.rb (/usr/share/foreman/app/helpers)
when /gentoo/i
"Gentoo"
when /SLC/i
"SLC"
when /AIX/i
"AIX"
else
And in manifest.yaml (/usr/share/foreman/public/assets)
---
AIX.png: AIX.png
Hi,
By using Ruediger Mueck's modifications and patching /usr/share/foreman/app/services/facts_importer.rb in Foreman, AIX hosts finally show up on the hosts page. I did not want to directly patch the operatingsystemrelease fact because it would be too complicated to manage the facter package upgrade.
Here is the patch :
--- facts_importer.rb.old 2013-10-30 09:40:50.000000000 +0100
+++ facts_importer.rb 2013-10-30 09:34:50.000000000 +0100
@@ -28,6 +28,9 @@
when /sid/i
orel = "99"
end
+ elsif os_name[/AIX/i]
+ majoraix, tlaix, spaix, yearaix = orel.split("-")
+ orel = majoraix + "." + tlaix + spaix
end
major, minor = orel.split(".")
major.to_s.gsub!(/\D/,'') unless is_numeric? major
- Description updated (diff)
- Category set to Unattended installations
- Status changed from New to Ready For Testing
- Target version set to 1.9.3
- Translation missing: en.field_release set to 2
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #4570: AIX Operating System version is shown in a strange way. added
Also available in: Atom
PDF