Merge branch '17535-test-provision-jenkins'
[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-10"
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/#\ BRANCH=\"main\"/\ BRANCH=\"main\"/g;
39                                     s#CONTROLLER_EXT_SSL_PORT=443#CONTROLLER_EXT_SSL_PORT=8443#g' \
40                                     /vagrant/local.params.example.single_host_multiple_hostnames > /tmp/local.params.single_host_multiple_hostnames"
41      arv.vm.provision "shell",
42                       path: "provision.sh",
43                       args: [
44                         # "--debug",
45                         "--config /tmp/local.params.single_host_multiple_hostnames",
46                         "--test",
47                         "--vagrant"
48                       ].join(" ")
49    end
50
51    # A single_host single_hostname example
52    config.vm.define "arvados-sh-sn" do |arv|
53      arv.vm.box = "bento/debian-10"
54      arv.vm.hostname = "zeppo"
55      # CPU/RAM
56      config.vm.provider :virtualbox do |v|
57        v.memory = 2048
58        v.cpus = 2
59      end
60  
61      # Networking
62      # WEBUI PORT
63      arv.vm.network "forwarded_port", guest: 9443, host: 9443
64      # WORKBENCH1
65      arv.vm.network "forwarded_port", guest: 9444, host: 9444
66      # WORKBENCH2
67      arv.vm.network "forwarded_port", guest: 9445, host: 9445
68      # KEEPPROXY
69      arv.vm.network "forwarded_port", guest: 35101, host: 35101
70      # KEEPWEB
71      arv.vm.network "forwarded_port", guest: 11002, host: 11002
72      # WEBSHELL
73      arv.vm.network "forwarded_port", guest: 14202, host: 14202
74      # WEBSOCKET
75      arv.vm.network "forwarded_port", guest: 18002, host: 18002
76      arv.vm.provision "shell",
77                       inline: "cp -vr /vagrant/config_examples/single_host/single_hostname /home/vagrant/local_config_dir;
78                                cp -vr /vagrant/tests /home/vagrant/tests;
79                                sed 's#HOSTNAME_EXT=\"\"#HOSTNAME_EXT=\"zeppo.local\"#g;
80                                     s#cluster_fixme_or_this_wont_work#zeppo#g;
81                                     s/#\ BRANCH=\"main\"/\ BRANCH=\"main\"/g;
82                                     s#domain_fixme_or_this_wont_work#local#g;' \
83                                     /vagrant/local.params.example.single_host_single_hostname > /tmp/local.params.single_host_single_hostname"
84      arv.vm.provision "shell",
85                       path: "provision.sh",
86                       args: [
87                         # "--debug",
88                         "--config /tmp/local.params.single_host_single_hostname",
89                         "--test",
90                         "--vagrant"
91                       ].join(" ")
92    end
93 end