This drives me nuts so I just wanted to check if anyone here have found a solution / are using something similar.
I want to create a number of rules using the rest API. As the rules Rest API does not work with JSON and instead require a Python dict for “raw_data” its really hard to use any other language
As Ansible will escape any ansible variable used in jinja2 , for example
raw_data: “{ ‘label:’ ‘{{ ansible_variable }}’ }”
Checkmk will complain saying my value is not a string (as its escaped like "
Is there a way of solving this without having to write a python module?
I had the same problems in a project where we where using PHP and I had to remove the ESCAPE after the JOSN was produced, any change this can be done as well?
I have tried many options and even asked ChatGTP for some guidelines, I have even tested to create the dict using some loops and almost manually created the JSON.
But it’s *** impossible to tell Ansible to not to touch a specific value as it should be treated like a dict.
Currently I’m thinking just to call an external script from Ansible when creating my rules as this blocks everything.