Currently we have a yaml file and rendering is done using jinja2 templating. When trying to dynamically update the env value between the string in yaml config returns always different errors and unsuccessful. Here is the requirement,
I want the output like this,
account_details:
account.private.key.id: {{secrets/team-demand-production-scope/private_key_id}}
Couple of things to note and seems tricky,
- Need {{ }} to be added along with value
- production keyword is not static and should be rendered dynamically like this {{ env }}. We have the value getting populated for env as either test/production, but the problem is using templated field in the middle of the string.
Tried with the below already and successful but the problem with adding {{ env }} in the middle. Could someone please suggest something.
account_details:
account.private.key.id: "{{ "{{secrets/team-demand-production-scope/private_key_id}}" }}"