Facts import drops long arrays

A fact with a long array as value will not get imported.

Expected outcome:
Don’t drop facts with long arrays as value.

Foreman and Proxy versions:
Foreman = 2.3.2
DNS = 2.3.2
TFTP, DHCP, and BMC = 1.24.3
Puppet and Puppet CA = 1.24.3
Everything from foreman repo.

Distribution and version:
Debian buster (10)

Puppet = 5 from puppetlabs repo

Other relevant data:
We are about to upgrade to puppet 6 and therefore we got to refactor our codebase which is quite big and in parts fairly ancient. Since we already have to touch much puppet-code in the process we decided to make it puppet 7 compatible right away. After upgrading to puppet 6 we want to upgrade to foreman 3.x .

With puppet 7 comes facter 4. Facter 4 will complain when the size of strings are to high. Some of our older facts are space separated list which facter 4 will complain about. In order to do it the right way, we have to change this to structured facts containing an array. We also took the opportunity to rename the fact, so we deal with a new fact to import into foreman.

I searched a bit an found this thread Foreman 1.24 will drop too many facts . I guess foreman doesn’t distinguishes between arrays and hashes when counting the elements of a structured fact, but i think it should. An array ends up as string in the database and i don’t see how this impacts performance in a way that the fact should be dropped. Please correct me if i am wrong about this.

I also saw that you are thinking about some reconstruction on fact import RFC: Dropping nested (structured) facts maybe this problem will just vanish when the work is done?

1 Like

Hey yeah feel free to patch Foreman to only drop hashes if that’s what you want.