I am new to ansible and need understading on below problem statement. Please help me with the code.
Following is the content of json file named, problem.json :-
{
"items": [
{
"type": "node1',
"id": "11",
"node": "server1",
"state": "finished",
"output": "output1"
}
]
"items": [
{
"type": "node2',
"id": "22",
"node": "server2",
"state": "error",
"output": "output2"
}
]
}
We need to read the json file and and create a output like below for each respective item (ther are several items in one json" using ansible playbook:-
Check if state is finished then below output:-
[
{
"node": "server1",
"state": "finished",
"output": "output1"
}
{
"node": "serverx",
"state": "finished",
"output": "outputx"
}
]
If state is error, then display node name with error message.
"node1'
...) and test it e.g. yamllint.com – Vladimir Botka