Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JSON and YAML formats #65

Closed
nmaludy opened this issue Jul 21, 2018 · 3 comments
Closed

Support JSON and YAML formats #65

nmaludy opened this issue Jul 21, 2018 · 3 comments

Comments

@nmaludy
Copy link
Contributor

nmaludy commented Jul 21, 2018

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
Copy link

+1

@ghoneycutt
Copy link
Owner

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
Copy link
Contributor Author

nmaludy commented Mar 25, 2020

Awesome! That is totally cool with me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants