Skip to content

Instantly share code, notes, and snippets.

@bruienne
Last active December 16, 2015 22:20
Show Gist options
  • Select an option

  • Save bruienne/5506715 to your computer and use it in GitHub Desktop.

Select an option

Save bruienne/5506715 to your computer and use it in GitHub Desktop.
Nested JSON to fact example
JSON external fact:
{
<SNIP>
"Conditions": {
"arch": "x86_64",
"hostname": "XXXXXX.local",
"ipv4_address": [
"xx.xx.xx.xx"
],
"machine_model": "MacBookPro10,1",
"machine_type": "laptop",
"munki_version": "0.8.3.1629",
"os_vers": "10.8.2",
"os_vers_major": 10,
"os_vers_minor": 8,
"os_vers_patch": 2,
"serial_number": "ABCDEFGHIJKL"
},
<SNIP>
"facter conditions" output:
admin$ facter conditions
{"arch"=>"x86_64", "hostname"=>"XXXXXX.local", "ipv4_address"=>["xx.xx.xx.xx"], "machine_model"=>"MacBookPro10,1", "machine_type"=>"laptop", "munki_version"=>"0.8.3.1629", "os_vers"=>"10.8.2", "os_vers_major"=>10, "os_vers_minor"=>8, "os_vers_patch"=>2, "serial_number"=>"ABCDEFGHIJKL"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment