Feature #335

Host facts not displayed in the /hosts/ view

Added by Brian Gallew 2 months ago. Updated 12 days ago.

Status:Feedback Start:07/01/2010
Priority:Normal Due date:
Assigned to:Ohad Levy % Done:

0%

Category:Web Interface
Target version:0.1-6
Branch:

Description

When using Foreman strictly as a reporting tool, the individual host view doesn't display the values for Domain, Puppet Environment, Host Architecture, Host Operating System, or Host Group, even though facts are available for all of them. I'll see if I can put together a patch that will only pull the facts in if the system isn't otherwise configured.

hosts-view.png - Snapshot of display (9.2 KB) Brian Gallew, 07/01/2010 06:40 pm

facts_as_necessary.diff (1.9 KB) Brian Gallew, 07/01/2010 09:34 pm

History

Updated by Ohad Levy 2 months ago

  • Status changed from New to Feedback
  • Target version deleted (0.1-6)

this is not really a bug, but rather that foreman has not been configured to fetch the facts from puppet.

see the rake fact importer tasks (or populate task if you are using storeconfigs) or the import_facts scripts.

Updated by Brian Gallew 2 months ago

Attached is a diff that will use the values from host.fv() if the appropriate values are not set for the host (e.g. host.domain). This patch is against 0.1-5.

Updated by Brian Gallew 2 months ago

Ohad Levy wrote:

this is not really a bug, but rather that foreman has not been configured to fetch the facts from puppet.

see the rake fact importer tasks (or populate task if you are using storeconfigs) or the import_facts scripts.

I'm using storeconfigs and I've run the importer task. I've never seen any documentation pointing to a populate task. Reading the rakefile, that doesn't touch any of the fields that Foreman generally manages (domain, arch, os, model, and environment). And again, if you aren't using Foreman to manage that data, then nothing is displayed in either the _overview or _minilist. The diff I've attached will only affect the display when the associated host.whatever field is empty, and doesn't touch the DB.

Updated by Ohad Levy 26 days ago

I'm willing to accept the patch, but it seems like a lot of repetition between the fact importer code...

Do you think it might be better to update the docs so other people wont have the same problem as you do? (IMHO it would also be faster not to query the facts directly).

Updated by Brian Gallew 22 days ago

I have to admit that 9 lines of code (replacing 5 existing lines) doesn't seem like a lot of repetition to me. OTOH, if the fact importer code is already supposed to be importing data from the hosts, maybe it makes sense for me to look there and patch that to populate the Foreman tables when there is no existing data? If that's what it would take to make an acceptable patch, I can work on it.

Updated by Ohad Levy 13 days ago

Brian Gallew wrote:

I have to admit that 9 lines of code (replacing 5 existing lines) doesn't seem like a lot of repetition to me. OTOH, if the fact importer code is already supposed to be importing data from the hosts, maybe it makes sense for me to look there and patch that to populate the Foreman tables when there is no existing data? If that's what it would take to make an acceptable patch, I can work on it.

Sorry for the late response.
Yes, thats what I meant, it makes far more sense to make sure we import the data correctly.
(its also important for other usage cases - so imho - it would be better).

thanks

Updated by Brian Gallew 12 days ago

OK, I'll get this refactored and submit a new patch. It'll take me a few days, probably.

Also available in: Atom PDF