Bug 1132402
| Summary: | [RFE] Support Facter 2 structured facts | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Stephen Benjamin <stbenjam> |
| Component: | Fact | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED ERRATA | QA Contact: | Sebastian Gräßl <sgraessl> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.0.4 | CC: | bkearney, cwelton, jfoots, riehecky, sgraessl |
| Target Milestone: | Unspecified | Keywords: | FutureFeature, Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://projects.theforeman.org/issues/4528 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-02-21 12:28:04 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1132363 | ||
Created from redmine issue http://projects.theforeman.org/issues/4528 This is referring to the ability to store, view and use structured facts in the web UI under Monitor > Facts. Upstream bug component is Fact Moving to POST since upstream bug http://projects.theforeman.org/issues/4528 has been closed *** Bug 1401123 has been marked as a duplicate of this bug. *** Verified on Satellite - 6.3.0 snap 10. Structured Facts are imported (converting the the value to a string) Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:0336 |
Facter 2 is at RC1, and while it has no structered facts by default, it will have in the future, and people will start writing their own probably even sooner. I quickly looked into this using the foreman_chef plugin. I came up with this: 1. Add 'plainify' and 'get_key' to node.rb from chef_foreman_handler, and change 'build_body' to call: {'facts' => plainify(puppet_facts['values'].merge({:_type => 'foreman_chef'})).flatten.inject(&:merge), 'name' => hostname, 'certname' => certname} 2. Add foreman_chef plugin to Foreman 3. Fix https://github.com/theforeman/foreman/blob/develop/app/services/fact_importer.rb#L79 to not drop Integers 4. (optional) Handle changes of fact type. Currently if you upload "foo: bar" and then upload "foo: { "bar" => "quux" }" it won't display properly due to the old string-type fact in the db. We'll probably want to move the hash-handling code out of foreman_chef and into core. I'd also consider investigating the way we compress and uncompress the facts hash with '::' vs just sending/parsing the whole hash directly.