Is it possbile to define l3_edge links in to different yaml files and then both be used in avd #4868
-
|
Hello AVD community, I would like to maintain two separate YAML files for different link definitions — for example, one for “Connected Endpoints” and another for “Essential Links.” Ultimately, I need to feed all of these links into the same l3_edge structure that the AVD solution expects. Instead, I want to merge both sets of link data into a single variable (l3_edge) at runtime using Ansible’s variable-merging capabilities. The challenge is that we have list data (e.g., p2p_links), which typically gets overwritten rather than merged unless extra steps are taken. Below is a simplified, anonymized example to illustrate what I mean: Finally, I would like to produce a combined l3_edge variable that includes both sets of data, for example: Question: Are there recommended best practices for list merging in Ansible (e.g., using combine, list_merge='append', etc.) to handle this scenario? Are there any pitfalls I should watch out for when managing separate files at the group_vars level and merging them in a “final” file (e.g., group_vars/all)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Sorry for the delayed answer. I hope you have figured it out in the meantime.
You have to use inline jinja in the Ansible inputs like you suggest below.
No I don't know of others doing this.
I would strongly suggest only sourcing profiles from a single place so you don't accidentially get duplicate profiles. I also expect handling of IDs etc will quickly become a mess. Notice that we have two identical models which are backed by the same code, so you could maybe use both to simplify your merge needs. |
Beta Was this translation helpful? Give feedback.
Sorry for the delayed answer. I hope you have figured it out in the meantime.
You have to use inline jinja in the Ansible inputs like you suggest below.
No I don't know of others doing this.
I would strongly suggest only sourcing profiles from a single place …