arista-netdevops-community / eos_designs_to_containerlab

Deploy and run AVD eos_designs in containerlab
Apache License 2.0
11 stars 4 forks source link

Variables to override directories would be helpful #3

Closed andrewbonney closed 1 month ago

andrewbonney commented 2 months ago

Dependent on where you choose to download the role to in your directory structure, and how you structure playbook directories, the values of playbook_dir and inventory_dir can differ wildly. This can make it quite hard to sensibly manage where the role creates output files and reads inputs from.

Would it be possible to add overrides similar to the following so that it's possible to set the paths used by the role's action plugin more directly?

Something like the following would be helpful: https://github.com/arista-netdevops-community/eos_designs_to_containerlab/blob/main/action_plugins/simulation.py#L151

        if first_sim_node:
            inventory_dir = hostvars[first_sim_node].get("inventory_dir_override", hostvars[first_sim_node]["inventory_dir"])
            playbook_dir = hostvars[first_sim_node].get("playbook_dir_override", hostvars[first_sim_node]["playbook_dir"])
bjmeuer commented 1 month ago

providing more flexibility in choosing the directories is a good point. Will take a look and get back.

bjmeuer commented 1 month ago

@andrewbonney I added the code to consider for defining the inventory and playbook directory, please test if this fits your needs.

The options to use are:

sim_inventory_dir_override:
sim_ playbook_dir_override:
andrewbonney commented 1 month ago

That does the job, thank you