Project

General

Profile

Actions

Feature #4528

closed

Support Facter 2 structured facts

Added by Greg Sutcliffe about 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

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.


Related issues 10 (2 open8 closed)

Related to Foreman - Feature #2293: Support structured factsDuplicate03/08/2013Actions
Related to Foreman - Feature #3339: Support for nested facts and specialised pluginsClosedMarek Hulán10/17/2013Actions
Related to Foreman - Feature #7525: Report volume sizes via facterClosedLukas Zapletal09/18/2014Actions
Related to Discovery - Feature #3860: Implement fully automated provisioningClosedLukas Zapletal12/12/2013Actions
Related to Foreman - Tracker #8447: Puppet 4 supportClosed11/19/2014

Actions
Related to Foreman - Feature #15522: Support for array/multi-valued factsNew06/27/2016Actions
Related to Salt - Refactor #15591: Use new structured facts parserNew07/06/2016Actions
Related to Foreman - Bug #16576: Structured facts importer is extremely slowClosedDominic Cleal09/15/2016Actions
Has duplicate Foreman - Bug #6414: structured facts not displayed in foremanDuplicate06/27/2014Actions
Has duplicate Foreman - Feature #12703: Layout aggregated fact value display formatDuplicate12/04/2015Actions
Actions

Also available in: Atom PDF