Open AGirin opened 1 month ago
yaml
in your example is a dictionary/hashmap
. You just access the value in a dictionary like you would any value in jinja.
So your code should be
{%- set a = yaml[proj][env] %}
All of your example is just plain jinja (https://jinja.palletsprojects.com/en/3.0.x/templates/#variables) and really has nothing to with salt specifically except that it uses jinja for the default renderer.
Thanks! It works.
Output:
Is it possible to access test yaml from dynamically created variable?
As I really want to return yaml.test.dev value no entire yaml + test.dev...