Add option to choose sync_type

This commit is contained in:
Łukasz Oleś 2015-09-16 06:25:56 +00:00
parent c3278c7cf2
commit c5ea07e580
3 changed files with 28 additions and 6 deletions

28
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 ' '}"
@ -67,10 +68,17 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end
config.vm.provider:libvirt do |libvirt|
config.vm.synced_folder ".", "/vagrant", type: "9p", disabled: false, accessmode: "mapped"
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