I have some ansible automation which deploys aws lambda functions. At some point I use below syntax:
env: "{{ l_common_env_vars | combine(l_per_env_vars) }}"
to create a dict with environment variables for a given function. The problem is that content of l_common_env_vars
and l_per_env_vars
source dictionaries has lowercase keys, example:
redis_url: some_url
and as a result destination env
dictionary has keys also in lowercase.
I would like to have all mentioned keys in uppercase:
REDIS_URL: some_url
I tried to use {{ env | upper }}
but it changes case for both keys and their values which is not what I need:
REDIS_URL: SOME_URL
Is there any way to convert to uppercase only keys of env
dictionary?
Thanks in advance for all help!
Best regards, Rafal.