0

I have file text structured as follows

key1,value1

I want to add these key values as facters in my host. I have splitted those key (configs[0]) , values (configs[1]). How to add those to facters using ruby. I have tried following code but not succeeded

configs = File.read("........configuration.txt").split(",").map(&:strip)

Facter.add(configs[0]){
            setcode { configs[1])
            }

Regards, Malintha

Malintha
  • 4,512
  • 9
  • 48
  • 82

0 Answers0