Add option to choose sync_type
This commit is contained in:
parent
c3278c7cf2
commit
c5ea07e580
28
Vagrantfile
vendored
28
Vagrantfile
vendored
@ -31,6 +31,7 @@ end
|
|||||||
SLAVES_COUNT = cfg["slaves_count"]
|
SLAVES_COUNT = cfg["slaves_count"]
|
||||||
SLAVES_RAM = cfg["slaves_ram"]
|
SLAVES_RAM = cfg["slaves_ram"]
|
||||||
MASTER_RAM = cfg["master_ram"]
|
MASTER_RAM = cfg["master_ram"]
|
||||||
|
SYNC_TYPE = cfg["sync_type"]
|
||||||
|
|
||||||
def ansible_playbook_command(filename, args=[])
|
def ansible_playbook_command(filename, args=[])
|
||||||
"ansible-playbook -v -i \"localhost,\" -c local /vagrant/bootstrap/playbooks/#{filename} #{args.join ' '}"
|
"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
|
end
|
||||||
|
|
||||||
config.vm.provider:libvirt do |libvirt|
|
config.vm.provider:libvirt do |libvirt|
|
||||||
config.vm.synced_folder ".", "/vagrant", type: "9p", disabled: false, accessmode: "mapped"
|
|
||||||
libvirt.driver = 'kvm'
|
libvirt.driver = 'kvm'
|
||||||
libvirt.memory = MASTER_RAM
|
libvirt.memory = MASTER_RAM
|
||||||
end
|
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
|
||||||
|
|
||||||
SLAVES_COUNT.times do |i|
|
SLAVES_COUNT.times do |i|
|
||||||
@ -95,11 +103,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||||||
]
|
]
|
||||||
v.name = "solar-dev#{index}"
|
v.name = "solar-dev#{index}"
|
||||||
end
|
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.driver = 'kvm'
|
||||||
libvirt.memory = SLAVES_RAM
|
libvirt.memory = SLAVES_RAM
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@ vagrant plugin install vagrant-mutate
|
|||||||
vagrant mutate cgenie/solar-master libvirt
|
vagrant mutate cgenie/solar-master libvirt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also change `sync_type` in your custom `vagrant-settings.yml` file.
|
||||||
|
|
||||||
# Use solar
|
# Use solar
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
@ -4,3 +4,7 @@
|
|||||||
slaves_count: 2
|
slaves_count: 2
|
||||||
slaves_ram: 1024
|
slaves_ram: 1024
|
||||||
master_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
|
||||||
|
Loading…
Reference in New Issue
Block a user