I have a json object in an Ansible variable (my_var), which contains values similar to the following:
{
"Enabled": "true"
"SomeOtherVariable": "value"
}
I want to modify the value of Enabled in my_var and have tried the following:
set_fact:
my_var.Enabled: false
and
set_fact:
my_var['Enabled']: false
Which both give errors similar to:
"The variable name 'my_var.Enabled' is not valid. Variables must start with a letter or underscore character, and contain only letters, numbers and underscores."
Can this be done with set_fact or is there some other way of achieving this?
this was my solution - probably not the most eloquent: