Merge remote-tracking branch 'MajewskiKrzysztof/exclude_home_project_parameter' into...
[arvados.git] / tools / salt-install / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: AGPL-3.0
6
7 # Vagrantfile API/syntax version. Don"t touch unless you know what you"re doing!
8 VAGRANTFILE_API_VERSION = "2".freeze
9
10 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
11   config.ssh.insert_key = false
12   config.ssh.forward_x11 = true
13
14    # A single_host multiple_hostnames example
15    config.vm.define "arvados-sh-mn" do |arv|
16      arv.vm.box = "bento/debian-11"
17      arv.vm.hostname = "harpo"
18      # CPU/RAM
19      config.vm.provider :virtualbox do |v|
20        v.memory = 2048
21        v.cpus = 2
22      end
23
24      # Networking
25      # WEBUI PORT
26      arv.vm.network "forwarded_port", guest: 8443, host: 8443
27      # KEEPPROXY
28      arv.vm.network "forwarded_port", guest: 25101, host: 25101
29      # KEEPWEB
30      arv.vm.network "forwarded_port", guest: 9002, host: 9002
31      # WEBSOCKET
32      arv.vm.network "forwarded_port", guest: 8002, host: 8002
33      arv.vm.provision "shell",
34                       inline: "cp -vr /vagrant/config_examples/single_host/multiple_hostnames /home/vagrant/local_config_dir;
35                                cp -vr /vagrant/tests /home/vagrant/tests;
36                                sed 's#cluster_fixme_or_this_wont_work#harpo#g;
37                                     s#domain_fixme_or_this_wont_work#local#g;
38                                     s#CONTROLLER_EXT_SSL_PORT=443#CONTROLLER_EXT_SSL_PORT=8443#g;
39                                     s#RELEASE=\"production\"#RELEASE=\"development\"#g;
40                                     s/# VERSION=.*$/VERSION=\"latest\"/g;
41                                     s/#\ BRANCH=\"main\"/\ BRANCH=\"main\"/g' \
42                                     /vagrant/local.params.example.single_host_multiple_hostnames > /tmp/local.params.single_host_multiple_hostnames"
43
44      arv.vm.provision "shell",
45                       path: "provision.sh",
46                       args: [
47                         # "--debug",
48                         "--config /tmp/local.params.single_host_multiple_hostnames",
49                         "--development",
50                         "--test",
51                         "--vagrant"
52                       ].join(" ")
53    end
54
55    # A single_host single_hostname example
56    config.vm.define "arvados-sh-sn" do |arv|
57      arv.vm.box = "bento/debian-10"
58      arv.vm.hostname = "zeppo"
59      # CPU/RAM
60      config.vm.provider :virtualbox do |v|
61        v.memory = 2048
62        v.cpus = 2
63      end
64  
65      # Networking
66      # WEBUI PORT
67      arv.vm.network "forwarded_port", guest: 9443, host: 9443
68      # WORKBENCH1
69      arv.vm.network "forwarded_port", guest: 9444, host: 9444
70      # WORKBENCH2
71      arv.vm.network "forwarded_port", guest: 9445, host: 9445
72      # KEEPPROXY
73      arv.vm.network "forwarded_port", guest: 35101, host: 35101
74      # KEEPWEB
75      arv.vm.network "forwarded_port", guest: 11002, host: 11002
76      # WEBSHELL
77      arv.vm.network "forwarded_port", guest: 14202, host: 14202
78      # WEBSOCKET
79      arv.vm.network "forwarded_port", guest: 18002, host: 18002
80      arv.vm.provision "shell",
81                       inline: "cp -vr /vagrant/config_examples/single_host/single_hostname /home/vagrant/local_config_dir;
82                                cp -vr /vagrant/tests /home/vagrant/tests;
83                                sed 's#HOSTNAME_EXT=\"\"#HOSTNAME_EXT=\"zeppo.local\"#g;
84                                     s#cluster_fixme_or_this_wont_work#zeppo#g;
85                                     s/#\ BRANCH=\"main\"/\ BRANCH=\"main\"/g;
86                                     s#domain_fixme_or_this_wont_work#local#g;' \
87                                     /vagrant/local.params.example.single_host_single_hostname > /tmp/local.params.single_host_single_hostname"
88      arv.vm.provision "shell",
89                       path: "provision.sh",
90                       args: [
91                         # "--debug",
92                         "--config /tmp/local.params.single_host_single_hostname",
93                         "--test",
94                         "--vagrant"
95                       ].join(" ")
96    end
97 end