O'Reilly logo

Troubleshooting Puppet by Thomas Uphill

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JSON

Although not commonly used as the primary backend for Hiera, JavaScript Object Notation (JSON) is also a backend option. JSON is generally not as readable as YAML. It is primarily meant to be easily parsed. An advantage of JSON is that it is widely used by web applications and can be easily generated. The JSON syntax can be verified using Node.js and the JSON.parse JavaScript function.

Consider the following JSON code, which is stored in the example.json file:

{ "books" : [
{ "title":"Mastering Puppet" , "pages":"300" },
{ "title":"Puppet Cookbook" , "pages":"250" },
{ "title":"Troubleshooting Puppet" , "pages":"100" } 
  ]
}

We can parse the file with Node.js by using the JSON.parse function. Install the Node.js binary.

Tip

Node.js is available ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required