Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1132402 - [RFE] Support Facter 2 structured facts
[RFE] Support Facter 2 structured facts
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Fact (Show other bugs)
6.0.4
Unspecified Unspecified
unspecified Severity low (vote)
: GA
: Unused
Assigned To: satellite6-bugs
Sebastian Gräßl
http://projects.theforeman.org/issues...
: FutureFeature, Triaged
: 1401123 (view as bug list)
Depends On:
Blocks: 1132363
  Show dependency treegraph
 
Reported: 2014-08-21 05:47 EDT by Stephen Benjamin
Modified: 2018-02-21 07:28 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-21 07:28:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 4528 None None None 2016-04-22 12:49 EDT
Red Hat Product Errata RHSA-2018:0336 normal SHIPPED_LIVE Important: Satellite 6.3 security, bug fix, and enhancement update 2018-02-21 17:43:42 EST

  None (edit)
Description Stephen Benjamin 2014-08-21 05:47:58 EDT
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.
Comment 1 Stephen Benjamin 2014-08-21 05:48:00 EDT
Created from redmine issue http://projects.theforeman.org/issues/4528
Comment 3 Dominic Cleal 2014-08-21 06:00:18 EDT
This is referring to the ability to store, view and use structured facts in the web UI under Monitor > Facts.
Comment 5 Bryan Kearney 2015-08-25 14:07:00 EDT
Upstream bug component is Fact
Comment 6 Bryan Kearney 2016-07-06 12:03:02 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/4528 has been closed
Comment 9 Josh Foots 2016-12-16 13:51:53 EST
*** Bug 1401123 has been marked as a duplicate of this bug. ***
Comment 10 Sebastian Gräßl 2017-08-09 08:29:54 EDT
Verified on Satellite - 6.3.0 snap 10.

Structured Facts are imported (converting the the value to a string)
Comment 13 errata-xmlrpc 2018-02-21 07:28:04 EST
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

Note You need to log in before you can comment on or make changes to this bug.