ipspace / netlab

Making virtual networking labs suck less
https://netlab.tools
Other
409 stars 58 forks source link

Check for required ansible galaxy collection or python modules #1133

Closed ssasso closed 2 months ago

ssasso commented 2 months ago

It would be great - on create/initial phase - to check if the galaxy collections or python modules required to operate a device are installed.

We could add, on the device definition, a list of modules and galaxy collection to check, and perform the checks when creating the topology data (or, in general, before starting the devices).

For galaxy collections, the "machine friendly" list of installed collections could be obtained with:

ansible-galaxy collection list --format json

Python modules can be imported inside a try-except block.

ipspace commented 2 months ago

Ansible collection checking implemented in 9294ca0e5588d9e9eb404bd1b33dd31d3385dbe4. Checking Python modules is trivial.