These Ansible playbooks allow to create VyOS
VMs on Proxmox node with certain configured network settings as well as remove, start or stop these VMs.
1. Install Ansible
on a certain Linux host from which Ansible playbooks are to be run, this host is called for brevity below Ansible config host
For Debian
Linux
sudo apt update
sudo apt install ansible
For Arch
Linux (including Manjaro)
sudo pacman -Syyuu --needed --noconfirm
sudo pacman -S ansible python-netaddr
apt install -y python3-pip python-dev build-essential
pip install virtualenv proxmoxer
3. Create vyos
cloud-init image, using vyos/vyos-vm-images Ansible playbook and copy it to ~/cloud-init-images
folder of Ansible config host
git clone https://github.com/Alliedium/awesome-proxmox.git
3. Copy ./inventory/single_vyos_sample
or ./inventory/double_vyos_sample
to ./inventory/my-vyos
folder.
4. Change the variables in the files ./inventory/my-vyos/hosts.yml
and ./inventory/my-vyos/group_vars/all.yml
as you need
- Here an example of data
./inventory/my-vyos/hosts.yml
file for creating 2vyos
VMs
Section vms
includes data for 2 VMs.
ansible-playbook -i ./inventory/my-vyos ./playbooks/batch-create-start.yml
ansible-playbook -i ./inventory/my-vyos ./playbooks/batch-stop-destroy.yml
ansible-playbook -i ./inventory/my-vyos ./playbooks/create-vms.yml
ansible-playbook -i ./inventory/my-vyos ./playbooks/start-vms.yml
ansible-playbook -i ./inventory/my-vyos ./playbooks/stop-vms.yml
ansible-playbook -i ./inventory/my-vyos ./playbooks/destroy-vms.yml