blob: b715ec50cb7887150131a218a46eb84ce05f9680 [file] [log] [blame]
Pawel Wieczorek09a63572019-12-17 15:33:06 +01001# -*- mode: ruby -*-
2# -*- coding: utf-8 -*-
3
4host_ip = "192.168.121.1"
Pawel Wieczorek9ee12582020-01-07 15:26:52 +01005synced_folder = "/vagrant"
Pawel Wieczorek09a63572019-12-17 15:33:06 +01006
7$replace_dns = <<-SCRIPT
8 HOST_IP="$1"
9 rm -f /etc/resolv.conf # drop its dynamic management by systemd-resolved
10 echo nameserver "$HOST_IP" | tee /etc/resolv.conf
11SCRIPT
12
13Vagrant.configure("2") do |config|
14 config.vm.box = "generic/ubuntu1804"
Pawel Wieczorek9ee12582020-01-07 15:26:52 +010015 config.vm.synced_folder ".", synced_folder, type: "rsync", rsync__exclude: "Vagrantfile"
Pawel Wieczorek09a63572019-12-17 15:33:06 +010016 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
19 apt-get update
20 apt-get install --assume-yes --quiet golang
21 SHELL
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/...
25 SHELL
Pawel Wieczorek9ee12582020-01-07 15:26:52 +010026 config.vm.provision "generate_config", type: :shell, privileged: false, inline: <<-SHELL
27 python3 #{synced_folder}/create_config.py
28 SHELL
Pawel Wieczorek09a63572019-12-17 15:33:06 +010029end