diff --git a/tests/scripts/generate_ssh_config.sh b/tests/scripts/generate_ssh_config.sh index feebaf676c..a98c1f181e 100644 --- a/tests/scripts/generate_ssh_config.sh +++ b/tests/scripts/generate_ssh_config.sh @@ -2,6 +2,8 @@ # Generate a custom ssh config from Vagrant so that it can then be used by # ansible.cfg +source vagrant.sh + path=$1 if [ $# -eq 0 ] diff --git a/tests/scripts/vagrant_up.sh b/tests/scripts/vagrant_up.sh index 05b17582f4..609f296c17 100644 --- a/tests/scripts/vagrant_up.sh +++ b/tests/scripts/vagrant_up.sh @@ -1,5 +1,10 @@ #!/bin/bash set -x + +source vagrant.sh + +test -d ~/.vagrant.d && mkdir ~/.vagrant.d + if [[ -n $1 ]]; then DIRECTORY=$1 shift diff --git a/vagrant.sh b/vagrant.sh new file mode 100644 index 0000000000..492c19176d --- /dev/null +++ b/vagrant.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +vagrant(){ + podman run -it --rm \ + -e LIBVIRT_DEFAULT_URI \ + -e SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" \ + -v /var/run/libvirt/:/var/run/libvirt/ \ + -v ~/.vagrant.d:/.vagrant.d \ + -v $(realpath "${PWD}"):${PWD} \ + -w "${PWD}" \ + --network host \ + --entrypoint /bin/bash \ + --security-opt label=disable \ + docker.io/vagrantlibvirt/vagrant-libvirt:latest \ + vagrant $@ +}