A while ago, the output from my knife commands (e.g. "knife node edit" -- which you should never use in production, by the way) changed from something like this:
{
"name": "i-27c2205f",
"chef_environment": "_default",
"normal": {
"tags": [
],
"mysql": {
"server_debian_password": "otLNhD_5jBpm1PPLGXpA",
"server_root_password": "KGCmAbHBXSId5fMXp92r",
"server_repl_password": "713jPVRzHLZ5woiH1Jgo",
"root_password_set": true
}
},
"run_list": [
"role[base-windows]",
"recipe[mysql::server]",
"role[wordpress-server-windows]"
]
}
to this:
{
"name": "i-27c2205f",
"chef_environment": "_default",
"normal": {"tags":[],"mysql":{"server_debian_password":"otLNhD_5jBpm1PPLGXpA","server_root_password":"KGCmAbHBXSId5fMXp92r","server_repl_password":"713jPVRzHLZ5woiH1Jgo","root_password_set":true}},
"run_list": ["role[base-windows]","recipe[mysql::server]","role[wordpress-server-windows]"]
}
I finally tracked it down to our old friend, the Ruby JSON gem.
Ruby 1.9.3 comes with json 1.5.5
out of the box, and Chef will work fine with that. Chef's gemspec constraint is <= 1.7.7, > 1.4.4
and all is copacetic.
However, many tools now expect json >= 1.7.7
, and if they install this Gem (or if you install it into Chef's Omnibus Ruby), Chef will happily use that version. As soon as it does, the JSON gem will start formatting all the output in a compressed way.