ghoneycutt / puppet-module-facter

Puppet module to manage Facter
Other
2 stars 22 forks source link

Support JSON and YAML formats #65

Closed nmaludy closed 4 years ago

nmaludy commented 6 years ago

Would be cool to support JSON and YAML formats so things like hashes and arrays could be written to fact files.

Thoughts on what it might look like:

array_data = ['a', 'b', 'c']

facter::fact { 'array_data':
  value  => $array_data,
  format => 'json',
}
hash_data = {'a' => 'value', 'b' => 'data'}

facter::fact { 'hash_data':
  value  => $hash_data,
  format => 'yaml',
}
aba-rechsteiner commented 4 years ago

+1

ghoneycutt commented 4 years ago

I implemented this with facter::structured_data_fact in #68 It does not let you pick between yaml and json, but it shouldn't matter since we are totally managing that file. I went with YAML btw.

nmaludy commented 4 years ago

Awesome! That is totally cool with me!