I have task to modify value of a connector in a JSON file like this:
{
"school": [
{
"class": "class1",
"properties": {
"pupil": {
"name": "Mya",
"age": "8"
}
}
},
{
"class": "class2",
"properties": {
"pupil": {
"name": "Mya",
"age": "8"
}
}
}
]
}
How to create ansible playbook to set new value only for pupil’s “name” and “age” only in “class1”? I expect the result as below. Really appreciate your help please!
{
"school": [
{
"class": "class1",
"properties": {
"pupil": {
"name": "Jane",
"age": "9"
}
}
},
{
"class": "class2",
"properties": {
"pupil": {
"name": "Mya",
"age": "8"
}
}
}
]
}
New contributor
Hà Hoàng gadichoi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.