File: Vagrantfile

package info (click to toggle)
ruby-sshkit 1.21.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 700 kB
  • sloc: ruby: 3,522; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = 'hashicorp/precise64'
  config.vm.provision "shell", inline: <<-SHELL
  echo 'ClientAliveInterval 1' >> /etc/ssh/sshd_config
  echo 'ClientAliveCountMax 1' >> /etc/ssh/sshd_config
  service ssh restart
  SHELL

  json_config_path = File.join("test", "boxes.json")
  list = File.open(json_config_path).read
  list = JSON.parse(list)

  list.each do |vm|
    config.vm.define vm["name"] do |web|
      web.vm.network "forwarded_port", guest: 22, host: vm["port"]
    end
  end
end