2 # -*- coding: utf-8 -*-
4 host_ip = "192.168.121.1"
5 synced_folder = "/vagrant"
7 $replace_dns = <<-SCRIPT
9 rm -f /etc/resolv.conf # drop its dynamic management by systemd-resolved
10 echo nameserver "$HOST_IP" | tee /etc/resolv.conf
13 Vagrant.configure("2") do |config|
14 config.vm.box = "generic/ubuntu1804"
15 config.vm.synced_folder ".", synced_folder, type: "rsync", rsync__exclude: "Vagrantfile"
16 config.vm.provision "replace_dns", type: :shell, run: "always", inline: $replace_dns, args: host_ip
17 config.vm.provision "dependencies", type: :shell, inline: <<-SHELL
18 export DEBIAN_FRONTEND=noninteractive
20 apt-get install --assume-yes --quiet golang
22 config.vm.provision "binaries", type: :shell, privileged: false, inline: <<-SHELL
23 export GOPATH="${HOME}/go"
24 go get -u github.com/hound-search/hound/cmds/...
26 config.vm.provision "generate_config", type: :shell, privileged: false, inline: <<-SHELL
27 python3 #{synced_folder}/create_config.py