Foreman bulk update & insert - best approach

I just wonder what’s the best approach for the bulk operations in Foreman? I need do 2 things:

  • add several thousands of hosts
  • add or update facts periodically for all the hosts.

What’s best take on that?
Python script + multithreading or multiprocessing + foreman API?

I am particularly interested about the second - so facts uploading. It needs to be done on a periodicaly / every N hour / perhaps daily basis. Therefore it cannot take few hours to process making possibly foreman barely responsive.

Foreman and Proxy versions:

Distribution and version:
Ubuntu 20.04

What fact source are we talking about? If that’s puppet, it’s good to define some splay time, so all agents don’t wake up at the same time. Thousands of hosts shouldn’t be an issue. One the facts existsin Foreman, we only update the values for particular host. If the structure doesn’t change much, it’s lighter operation. All above should hold for default facts set, if you add thousands of custom facts (or use chef facter e.g.), this can become a bottleneck.

Thanks for replying.
Yeah… I forgot to mention the most important thing. Our fact source is ansible, however, I want to retrieve custom facts on a periodical basis (daily) and add those facts to the hosts which are in foreman.
So we’re not using puppet at all.

BTW. Is there a way to create a new fact source? Like custom fact source?