This adds an ansible dynamic inventory provider script for vagrant.
Currently only libvirt based vagrant boxes are supported. Also, the CPU of the test running machine must have KVM hardware virtualization enabled to run vagrant--and the script will raise an explanatory exception if it isn't.
It works analogously to the other ansible dynamic inventory provider scripts for docker, qcow2, etc. To use it, set the ANSIBLE_INVENTORY environment variable to the path of the script (or a directory containing the script) and set the TEST_SUBJECTS environment variable to include either a URL or local path to a vagrant box file. (Note: vagrant caches boxes, so there is no need to be concerned about repeated large downloads if a box is specified by URL.)
It writes an inventory-vagrant.log log file to the artifacts directory.
Since the required vagrant and vagrant-libvirt packages are very heavy on dependences, and the script won't necessary be used by everyone, it currently just checks for the presence of the required packages and raises an exception if they are missing. Question: is this an appropriate way to handle the package requirements? Or should they be included as Recommends in the package SPEC file anyhow? Or should the script try to install the packages if it finds them missing?
This adds an ansible dynamic inventory provider script for vagrant.
Currently only libvirt based vagrant boxes are supported. Also, the CPU of the test running machine must have KVM hardware virtualization enabled to run vagrant--and the script will raise an explanatory exception if it isn't.
It works analogously to the other ansible dynamic inventory provider scripts for docker, qcow2, etc. To use it, set the
ANSIBLE_INVENTORYenvironment variable to the path of the script (or a directory containing the script) and set theTEST_SUBJECTSenvironment variable to include either a URL or local path to a vagrant box file. (Note: vagrant caches boxes, so there is no need to be concerned about repeated large downloads if a box is specified by URL.)For example:
It writes an
inventory-vagrant.loglog file to the artifacts directory.Since the required vagrant and vagrant-libvirt packages are very heavy on dependences, and the script won't necessary be used by everyone, it currently just checks for the presence of the required packages and raises an exception if they are missing.
Question: is this an appropriate way to handle the package requirements? Or should they be included as Recommends in the package SPEC file anyhow? Or should the script try to install the packages if it finds them missing?