Bug #1489
AIX not showing up on Hosts page
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.
Related issues
Associated revisions
History
#1
Updated by Jon Whited over 6 years ago
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.
#2
Updated by Jon Whited over 6 years ago
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
#3
Updated by Ohad Levy over 6 years ago
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? :)
#4
Updated by Jon Whited over 6 years ago
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.
#5
Updated by Benjamin Papillon about 5 years ago
- Related to Feature #2445: Add OS image for AIX added
#6
Updated by Ruediger Mueck about 5 years ago
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
#7
Updated by Ludovic Dépinoy about 5 years ago
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
#8
Updated by Dominic Cleal almost 5 years ago
- Description updated (diff)
- Category set to Unattended installations
- Status changed from New to Ready For Testing
- Target version set to 1.9.3
- Legacy Backlogs Release (now unused) set to 2
#9
Updated by Ruediger Mueck almost 5 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 7e2880b62bc425d6c24272dab2f25f087ba79867.
#10
Updated by Dominic Cleal over 4 years ago
- Related to Bug #4570: AIX Operating System version is shown in a strange way. added
fixes #1489 - add AIX family and facts importer support