Merge pull request #154 from loles/libvirt

Libvirt
This commit is contained in:
CGenie 2015-09-16 08:31:31 +02:00
commit 306e73decc
3 changed files with 29 additions and 7 deletions

30
Vagrantfile vendored
View File

@ -31,6 +31,7 @@ end
SLAVES_COUNT = cfg["slaves_count"]
SLAVES_RAM = cfg["slaves_ram"]
MASTER_RAM = cfg["master_ram"]
SYNC_TYPE = cfg["sync_type"]
def ansible_playbook_command(filename, args=[])
"ansible-playbook -v -i \"localhost,\" -c local /vagrant/bootstrap/playbooks/#{filename} #{args.join ' '}"
@ -66,11 +67,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
v.name = "solar-dev"
end
config.vm.provider:libvirt do |libvirt|
config.vm.synced_folder ".", "/vagrant", type: "9p", disabled: false, accessmode: "mapped"
config.vm.provider :libvirt do |libvirt|
libvirt.driver = 'kvm'
libvirt.memory = MASTER_RAM
end
if SYNC_TYPE == 'nfs'
config.vm.synced_folder ".", "/vagrant", type: "nfs"
end
if SYNC_TYPE == 'rsync'
config.vm.synced_folder ".", "/vagrant", rsync: "nfs",
rsync__args: ["--verbose", "--archive", "--delete", "-z"]
end
end
SLAVES_COUNT.times do |i|
@ -95,11 +103,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
]
v.name = "solar-dev#{index}"
end
config.vm.provider:libvirt do |libvirt|
config.vm.synced_folder ".", "/vagrant", type: "9p", disabled: false, accessmode: "mapped"
libvirt.driver = 'kvm'
libvirt.memory = SLAVES_RAM
end
config.vm.provider :libvirt do |libvirt|
libvirt.driver = 'kvm'
libvirt.memory = SLAVES_RAM
end
if SYNC_TYPE == 'nfs'
config.vm.synced_folder ".", "/vagrant", type: "nfs"
end
if SYNC_TYPE == 'rsync'
config.vm.synced_folder ".", "/vagrant", rsync: "nfs",
rsync__args: ["--verbose", "--archive", "--delete", "-z"]
end
end
end

View File

@ -19,6 +19,8 @@ vagrant plugin install vagrant-mutate
vagrant mutate cgenie/solar-master libvirt
```
You can also change `sync_type` in your custom `vagrant-settings.yml` file.
# Use solar
``` bash

View File

@ -4,3 +4,7 @@
slaves_count: 2
slaves_ram: 1024
master_ram: 1024
# By default Virtualbox shared folder is used which is very slow
# Uncomment following option to change it.
# Possible options are: rsync, nfs
# sync_type: nfs