August 2015
Intermediate to advanced
144 pages
2h 58m
English
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.
Node.js is available ...
Read now
Unlock full access