Vagrant - CentOS, Debian i Ubuntu


#1

Wrzucam plik Vagrantfile do odpalenia dystrybucji najczęściej spotykanych na serwerach (CentOS 7, Debian 9, Ubuntu 18.04)
Może komuś się przyda do nauki czy zabawy.

servers=[
  {
    :hostname => "centos",
    :ip => "192.168.100.10",
    :box => "centos/7",
    :ram => 1024,
    :cpu => 1
  },
  {
    :hostname => "debian",
    :ip => "192.168.100.11",
    :box => "debian/stretch64",
    :ram => 1024,
    :cpu => 1
  },
  {
    :hostname => "ubuntu",
    :ip => "192.168.100.12",
    :box => "ubuntu/bionic64",
    :ram => 1024,
    :cpu => 1
  }
]


Vagrant.configure(2) do |config|
    servers.each do |machine|
        config.vm.define machine[:hostname] do |node|
            node.vm.box = machine[:box]
            node.vm.hostname = machine[:hostname]
            node.vm.network "private_network", ip: machine[:ip]
            node.vm.provider "virtualbox" do |vb|
                vb.customize ["modifyvm", :id, "--memory", machine[:ram]]
            end
        end
    end
end