This container builds upon the vagrant-libvirt slim container by adding Ansible as provisioner.
You can use this as a direct replacement for the official vagrant-libvirt container.
I prefer to use the vagrant-libvirt container because my preferred desktop OS, Arch Linux, offers newer package versions, which are incompatible with the vagrant-libvirt requirements.
However, the default container does not include Ansible, which I need to provision virtual machines, particularly for testing my k3s-git-ops project.
docker pull ghcr.io/madic-creates/vagrant-libvirt-ansible:latest
To use the container as the standard vagrant
command, add the following function to your bash/zsh configuration:
function vagrant() {
docker run -it --rm \
-e LIBVIRT_DEFAULT_URI \
-v /var/run/libvirt/:/var/run/libvirt/ \
-v ~/.vagrant.d:/.vagrant.d \
-v $(realpath "${PWD}"):${PWD} \
-w "${PWD}" \
--network host \
ghcr.io/madic-creates/vagrant-libvirt-ansible:latest \
vagrant $@
}
docker build -f Containerfile .