Ansible-Roles/roles/radius/molecule.md
2026-05-08 22:12:36 +03:00

1.2 KiB


sudo dnf install -y qemu-kvm libvirt-daemon-kvm virt-install virt-manager libvirt-devel

sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt $(whoami)
newgrp libvirt

Install vagrant

vagrant --version
vagrant plugin install vagrant-libvirt
vagrant plugin list
vagrant global-status

Install molecule

sudo dnf install python3-pip
python3 -m pip install --user molecule
python3 -m pip install --user "molecule-plugins[podman]" "molecule-plugins[vagrant]"

sudo apt install pipx 
pipx install molecule
pipx install --include-deps "molecule-plugins[podman]" "molecule-plugins[vagrant]" --force

https://github.com/ansible-community/molecule-plugins/tree/main/doc/vagrant

molecule init scenario vagrant

molecule --debug destroy --scenario-name vagrant
molecule reset --scenario-name vagrant

molecule test --scenario-name default --report --command-borders
molecule test --scenario-name vagrant --report --command-borders
molecule list

sudo virsh list --all
sudo virsh vol-list --pool default
sudo virsh vol-delete molecule._rAf.vagrant_stream10.img --pool default

cd ~/.ansible/tmp/molecule._rAf.vagrant
vagrant destroy -f
vagrant destroy up