Project

General

Profile

Feature #15522

Support for array/multi-valued facts

Added by Dominic Cleal about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Facts
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

It should be possible to store an array of multiple fact values for a single fact name, so array facts that are imported from config management tools can be stored with separate, queryable values, e.g. in the fact values list:

host.example.com    array_fact    value1
host.example.com array_fact value2
host.example.com array_fact value3

while currently the array is stringified:

host.example.com    array_fact    ["value1", "value2", "value3"]

@host.facts['array_fact'] should also return an array for templates. Smart variable matchers may also need support for matching against multiple values. Other bits of the UI and API that work with individual fact values will also need checking over (e.g. trending of fact values).

This will probably require a small schema change to permit multiple FactValues per host_id/fact_name_id.

Note this is different to #3339, which permitted nested facts (hashes) and #4528 which changes the Puppet fact importer to import nested facts.


Related issues

Related to Foreman - Feature #3339: Support for nested facts and specialised pluginsClosed2013-10-17
Related to Foreman - Feature #4528: Support Facter 2 structured factsClosed2014-03-03

History

#1 Updated by Dominic Cleal about 5 years ago

  • Related to Feature #3339: Support for nested facts and specialised plugins added

#2 Updated by Dominic Cleal about 5 years ago

  • Related to Feature #4528: Support Facter 2 structured facts added

Also available in: Atom PDF