I am facing while printing values from .epp template in puppet
- I have following data in hiera, which defines groups (array of hashes)
profiles::groups:
- name: 'admins'
type: 1
rights: []
- name: 'users'
type: 2
rights: []
- The above hiera key is called in .epp template like this
.....
groups = <%= require 'json'; JSON.pretty_generate scope['groups'] %>
.....
- Above declaration should print the values in file in following format (from above epp template) but gives error as mentioned below
.......
groups = [
{
"name": "admins",
"type": 1,
"rights": []
},
{
"name": "users",
"type": 2,
"rights": []
}
]
.....
Error Message: Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, epp(): Invalid EPP: Syntax error at 'json'
While declaring the same format in .erb template works fine and it produces desired output.