Sha256: 57ff99400ead734d3f3bb905a97ed66c2febeebaeb2668b50689b3c0cdbe94bf
Contents?: true
Size: 678 Bytes
Versions: 15
Compression:
Stored size: 678 Bytes
Contents
export function transformAnsiblePlaybook(playbook) { const ansiblePlaybook = new Object; ansiblePlaybook.id = playbook.id; ansiblePlaybook.name = playbook.name; ansiblePlaybook.groups = {}; if (playbook.hasOwnProperty('groups')) { Object.entries(playbook.groups).forEach(([group_name,group_vars]) => { ansiblePlaybook.groups[group_name] = []; let id=0; Object.entries(group_vars).forEach(([var_name,var_value]) => { let entry = { id: id, name: var_name, value: var_value } ansiblePlaybook.groups[group_name].push(entry); id += 1; }); }); } return ansiblePlaybook; }
Version data entries
15 entries across 15 versions & 1 rubygems