From f42c2df5882cc3bf8f3134ca1abe0a9796d986c9 Mon Sep 17 00:00:00 2001 From: Scott Lowe Date: Wed, 20 Dec 2017 08:22:05 -0700 Subject: [PATCH] Add Libvirt support Update files to support Libvirt as a virtualization provider for Vagrant Signed-off-by: Scott Lowe --- centos-atomic/docker-tcp-ansible/Vagrantfile | 12 ++++++++++++ centos-atomic/docker-tcp-ansible/machines.yml | 1 + 2 files changed, 13 insertions(+) diff --git a/centos-atomic/docker-tcp-ansible/Vagrantfile b/centos-atomic/docker-tcp-ansible/Vagrantfile index fdb901d..9de1b53 100644 --- a/centos-atomic/docker-tcp-ansible/Vagrantfile +++ b/centos-atomic/docker-tcp-ansible/Vagrantfile @@ -23,6 +23,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Don't check for box updates srv.vm.box_check_update = false + + # Set machine's hostname srv.vm.hostname = machine['name'] # Use VMware box by default @@ -61,6 +63,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.customize ['modifyvm', :id, '--nictype1', 'virtio'] vb.customize ['modifyvm', :id, '--nictype2', 'virtio'] end # srv.vm.provider 'virtualbox' + + # Configure CPU & RAM per settings in machines.yml (Libvirt) + srv.vm.provider 'libvirt' do |lv,override| + lv.memory = machine['ram'] + lv.cpus = machine['vcpu'] + override.vm.box = machine['box']['lv'] + if machine['nested'] == true + lv.nested = true + end # if machine['nested'] + end # srv.vm.provider 'libvirt' end # config.vm.define # Provision the VM with Ansible diff --git a/centos-atomic/docker-tcp-ansible/machines.yml b/centos-atomic/docker-tcp-ansible/machines.yml index cb03628..e73c52e 100644 --- a/centos-atomic/docker-tcp-ansible/machines.yml +++ b/centos-atomic/docker-tcp-ansible/machines.yml @@ -2,6 +2,7 @@ - box: vmw: "bento/centos-7.1" vb: "centos/atomic-host" + lv: "centos/atomic-host" name: "atomic-01" nested: false nics: