From b5f999c1ceb5c3582d7602890f76d3bbb09ddb33 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 2 Sep 2015 11:13:36 +0200 Subject: [PATCH] Parametrize networks, box and provider Signed-off-by: Bogdan Dobrelya --- README.md | 2 ++ Vagrantfile | 7 ++----- examples/bootstrap/vagrant-settings.yaml | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9be5bef0..8c68e21e 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ cd solar ``` * 1. Configure vagrant-settings.yml, for example: ``` +vagrant_provider: virtualbox +vagrant_box: cgenie/solar-master slaves_count: 2 slaves_ram: 2048 slaves_cpu: 2 diff --git a/Vagrantfile b/Vagrantfile index 6902c370..334f5a70 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -71,9 +71,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", inline: master_pxe, privileged: true unless PREPROVISIONED config.vm.provision "file", source: "~/.vagrant.d/insecure_private_key", destination: "/vagrant/tmp/keys/ssh_private" config.vm.provision "file", source: "bootstrap/ansible.cfg", destination: "/home/vagrant/.ansible.cfg" - MASTER_IPS.each do |ip| - config.vm.network "private_network", ip: "#{ip}" - end config.vm.host_name = "solar-dev" config.vm.provider :virtualbox do |v| @@ -85,10 +82,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| "--cpus", MASTER_CPUS, "--ioapic", "on", ] + if PARAVIRT_PROVIDER v.customize ['modifyvm', :id, "--paravirtprovider", PARAVIRT_PROVIDER] # for linux guest end - v.name = "solar-dev" end config.vm.provider :libvirt do |libvirt| @@ -147,10 +144,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| "--cpus", SLAVES_CPUS, "--ioapic", "on", ] + if PARAVIRT_PROVIDER v.customize ['modifyvm', :id, "--paravirtprovider", PARAVIRT_PROVIDER] # for linux guest end - v.name = "solar-dev#{index}" end config.vm.provider :libvirt do |libvirt| diff --git a/examples/bootstrap/vagrant-settings.yaml b/examples/bootstrap/vagrant-settings.yaml index 131d8c99..f9526e57 100644 --- a/examples/bootstrap/vagrant-settings.yaml +++ b/examples/bootstrap/vagrant-settings.yaml @@ -1,6 +1,7 @@ # rename it to vagrant-settings.yml then Vagrantfile # will use values from this file - +vagrant_provider: virtualbox +vagrant_box: cgenie/solar-master slaves_count: 2 slaves_ram: 1024 slaves_cpu: 1