I need to insert multiple facts on many machines(100+) based on its hostname. All the machines get a single app deployed but the app configuration differs and also machines form part of different clusters. I am trying to find the right approach to implement this. One approach I found in How can I create a custom :host_role fact from the hostname? wherein there is a condition in facter add code block to check for hostname.
I was also thinking if there is a way to add multiple facts in one facter add call instead of having 1 per facter as that way I can logically organize my code on cluster/machines instead of facts.
Example:
Machine1 and its facts: clustername: C1 Java version: 1.8.60 ProcessRuns: 3
Machine2 and its facts: clustername: C1 Java version: 1.8.60 ProcessRuns: 1
Machine3 and its facts: clustername: C2 Java version: 1.9.00 ProcessRuns: 1
Machine4 and its facts: clustername: C2 Java version: 1.9.00 ProcessRuns: 2
Machine5 and its facts: clustername: C3 Java version: 1.9.60 ProcessRuns: 1