Open gadgieOps opened 2 days ago
Thank you for submitting this issue with elaborate background and details.
The role eos_config_deploy_cvp
needs a strict tree to create the container hierarchy. This tree is inferred from the Ansible inventory starting at the group set as root container. It is not possible to know which of the groups is the "correct one" from the Ansible inventory, if there are multiple parallel trees.
We could indeed decouple the container hierarchy from the inventory, and allow the user to pass in the hierarchy. This is already on the roadmap for our new role cv_deploy
, which pushes configs to the new Static Config Studio on CloudVision.
We do not plan to change the behavior of eos_config_deploy_cvp
, since the role will be replaced with cv_deploy
. eos_config_deploy_cvp
is tied to the older provisioning backend on CloudVision.
All that said, I am a bit confused about the output you see. I would expect an error to be raised by the module inventory_to_containers
instead of producing duplicate output keys. Which version of AVD are you using?
Thank you for the response. Glad to hear decoupling the inventory from the container hierarchy is on the roadmap for cv_deploy.
AVD 4.10.2.
Enhancement summary
We are unable to implement our internal best practice inventory format when using the eos_config_deploy_cvp role. We implement ansible in many areas of our business and have standardised on a format that ensures our inventories are simple, clean and scalable. We are able to continue with the current behaviour however it would be highly helpful to us if this behaviour wasn't present. I suspect this is the intended behaviour of the role and not a bug however other roles operate correctly such as eos_designs and eos_cli_config_gen.
We integrate AVD with other automations and for us to scale our work, we would like to be able to keep our code across all solutions as standardised as possible. Our goals are to make network automation as approachable as possible for engineers who have previously had little exposure in our industry.
It is unlikely I'll be able to afford the time (Given we have workarounds) to study the role in enough depth to raise a PR with suggested changes however I will keep it in mind. If this causes wider issues moving forwards.
Which component of AVD is impacted
eos_config_deploy_cvp
Use case example
Here is a snippet from our desired AVD inventory (M&E Red/Blue network and simplified for brevity):
We organise inventories like this as it allows host ansible_host definition in a single part of the YAML structure and allows us lots of flexibility using ansible's group_var directory structure.
When running an inventory in this format, eos configs are generated correctly however when deploying to CVP, the key parentContainerName is duplicated per host in the CVP structured config. For example:
Ansible error:
Describe the solution you would like
We would like eos_config_deploy_cvp to behave the same as eos_designs and eos_cli_config_gen and allow for hosts to be members of multiple groups. Furthermore, it would be great to decouple the anisble inventory structure from the container structure in CVP. This would allow more freedom to integrate with other automations and existing practices without compromising the operational structure in CVP.
Describe alternatives you have considered
Workarounds:
Workaround 2:
Issue with workaround 2:
structured config gets overwritten every time you run so you lose reference to it.
As we scale, it adds increasing cost to deployment as we have to run the CVP role multiple times (3 times in the example above however it's actually 6 for us currently).
Our container structure in CVP is flatter than we would like it to be because we're calling the container_root to be the hosts direct parent rather than the entire facility
Additional context
No response
Contributing Guide