I was wondering if there was some way to “evaluate” variables (like the python eval function).
For instance, I have one use case where I set shared memory for PostgreSQL as “2GB” and want to adapt the kernel.shmmax to fit it.
So, I want to take the “2GB” variable, add a base “128MB” to it, convert to bytes in a new variable and use that to put in sysctl.conf.
Using jinja2 filters, I can express it as a math expression, but I can’t find a way to evaluate the result.
An example playbook would be: