Simple collection to build multiple servers for Ansible testing including Rhel 8, rhel9, Centos9s and fedora 36. Testing was done on all above operating systems as well. This will also set up ~/.ansible.cfg to use the inventory file it creates in ~/vagrant/inventory.ini. Hopefully turn key lab environment. All comments are welcome via PR or issues!
Playbooks directory contains playbooks to run the roles.
ansible-galaxy collection install git+https://github.com/chadmf/chadmf.vagrant
ansible-galaxy collection install community.general
Does all of the things below (besides the destroy and cleanup) to spin up 4 small vms for testing. NOTE: this assumes you have an inventory file with [all] in it. If you do not you may want to change the all to localhost to run locally in the playbook.
ansible-playbook playbooks/vagrant_all.yml
Uses dnf module to install qemu-kvm and other dependencies needed for Vagrant.
ansible-playbook playbooks/vagrant_install.yml
This will create directories in /home/{{ ansible_user_id }}/vagrant/osname as well as run vagrant init to create the Vagrantfile
ansible-playbook playbooks/vagrant_config.yml
Starts the vms
ansible-playbook playbooks/vagrant_up.yml
Stops the vm
ansible-playbook playbooks/vagrant_down.yml
Destroys the vms
ansible-playbook playbooks/vagrant_destroy.yml
Removes all vagrant directories and ssh configs. Should do this with destroy but sometimes things fail...
ansible-playbook playbooks/vagrant_cleanup.yml