I'm new to Ansible, and i'm having a hard time figuring out how to get an expression to work. I'm try to run a command task that references a dictionary variable where the key i need to reference is dynamic as well. Relevant code (multilined for formatting):
tasks:
- name: set volume
command: az webapp config storage-account add --share-name shareName2
--access-key {{ kvsecrets['connectionstring-{{resources_name}}-key2'] }}
So kvsecrets is a dictionary registered by a previous task, and resources_name is a variable declared further up in the playbook. The syntax above doesn't work as it outputs kvsecrets['connectionstring-{{resources_name}}-key2'] without making the inner transformation. What is the proper format to get the value for that dictionary key?
Thanks!