Turning off/Handling Structured Facts in New Releases of Foreman?

Hi there,

Messaging about the latest release of Foreman (1.16). This may also be
pertinent to older versions as well however. (Can't pin it down easily in
the release notes).

I'm currently using Foreman 1.11 and one thing I have is a custom plugin to
interrogate certain custom facts I've written and display them. This
collects application specific data by querying custom facts (that are
structured and contain quite a bit of data) using scoped_search. The issue
I'm getting while testing in 1.16, where structured facts are now broken
down by the new fact importer are;

  • It doesn't seem possible to access an entire structured custom fact?
    As far as I can see while being imported it's all broken down and stored
    directly. An example would be the following below which previously I used
    to pull down from the database directly and parse, in addition as the key
    names "info1" etc are dynamic can't hardcode to pull out specific values.

{"info1":{"status":"X","time":"Y"},"info2":{"status":"X","time":"Z"},"info3":{"status":"X","time":"Y"},…}

  • The custom facts we have mentioned above can be quite verbose -
    meaning that what was previous 3 custom facts is translated to upwards of
    35-40, and it's not a great user experience on the UI to view data
    together, in many ways it was just easier to look at the json.

I can understand why this change was made for, but was wondering if there
was any way to turn structured fact importing like this off easily? Or if
not if anyone had any ideas how to replicate the previous functionality of
just being able to pull down an entire fact?

Hello,

May i know - if you have a found a solution to this?

I have faced a similar issue this week.

I have seen that foreman breaks down the hash/structured facts and makes it
difficult for me to iterate over the hash.

I cannot use the broken up facts, since they are static and my template
will become less dynamic with me mentioning each broken up fact.

I didnt know, foreman used to support storing nested hash previously? Could
we iterate them as hash in templates?

I would like to request this feature too, and hope it will be available
soon.

It was a big surprise for me, that it does not support storing facts as
hash - since i believe it does have a way to store smart variables as hash.

I used puppet razor before, and i know that it supports storing facts as
hash and query them as hash in templates.

I have been looking to migrate to foreman from puppet razor, and this is a
major roadblock.

··· On Friday, April 28, 2017 at 3:15:17 AM UTC-4, Iain Walmsley wrote: > > Hi there, > > Messaging about the latest release of Foreman (1.16). This may also be > pertinent to older versions as well however. (Can't pin it down easily in > the release notes). > > I'm currently using Foreman 1.11 and one thing I have is a custom plugin > to interrogate certain custom facts I've written and display them. This > collects application specific data by querying custom facts (that are > structured and contain quite a bit of data) using scoped_search. The issue > I'm getting while testing in 1.16, where structured facts are now broken > down by the new fact importer are; > > > - It doesn't seem possible to access an entire structured custom fact? > As far as I can see while being imported it's all broken down and stored > directly. An example would be the following below which previously I used > to pull down from the database directly and parse, in addition as the key > names "info1" etc are dynamic can't hardcode to pull out specific values. > > > {"info1":{"status":"X","time":"Y"},"info2":{"status":"X","time":"Z"},"info3":{"status":"X","time":"Y"},.................} > > > > - The custom facts we have mentioned above can be quite verbose - > meaning that what was previous 3 custom facts is translated to upwards of > 35-40, and it's not a great user experience on the UI to view data > together, in many ways it was just easier to look at the json. > > I can understand why this change was made for, but was wondering if there > was any way to turn structured fact importing like this off easily? Or if > not if anyone had any ideas how to replicate the previous functionality of > just being able to pull down an entire fact? >