rodrigobertin
4/25/2018 - 4:09 AM

Vagrant Multi Machine

Vagrant multiples maquias mismo archivo

# -*- mode: ruby -*-
# nano: set ft=ruby :

Vagrant.configure("2") do |config|

  # Definir maquina 1
  config.vm.define "web" do |web|
    #Nombre de la maquina
    web.vm.box = "apache"
    #Distribucion
    web.vm.box = "relativkreativ/ubuntu-17-minimal"
    #Ver actualizaciones
    web.vm.box_check_update = true
    #Puertos forwardeados
    web.vm.network "forwarded_port", guest: 80, host: 9999
    #Carpetas sincronizadas
    web.vm.synced_folder "/Volumes/DATA/SITES", "/var/www/html", mount_options: ["dmode=777", "fmode=777"], owner: "vagrant", group: "www-data"
    #IP privada de la maquina
    web.vm.network "private_network", ip: "192.168.33.10"
    #IP Publica de la maquina
    web.vm.network "public_network", bridge: "en1: Wi-Fi (AirPort)", ip:"<IP public>"
    #Definir ajustes de virtualbox
    web.vm.provider "virtualbox" do |vb|
      vb.gui = false #No mostrar interfaz
      vb.name = 'APACHE' #Nombre en virtualbox
      vb.memory = "512" #Memoria de la maquina
    end
  end

  # Definir maquina 2 
  config.vm.define "db" do |db|
    #Nombre de la maquina
    db.vm.box = "bases"
    #Distribucion
    db.vm.box = "relativkreativ/ubuntu-17-minimal"
    #Ver actualizaciones
    db.vm.box_check_update = true
    #Puertos forwardeados
    db.vm.network "forwarded_port", guest: 3306, host: 3306
    #Carpetas sincronizadas
    #db.vm.synced_folder "/Volumes/DATA/SITES", "/var/www/html", mount_options: ["dmode=777", "fmode=777"], owner: "vagrant", group: "www-data"
    #IP privada de la maquina
    db.vm.network "private_network", ip: "192.168.33.10"
    #IP Publica de la maquina
    db.vm.network "public_network", bridge: "en1: Wi-Fi (AirPort)", ip:"<IP public>"
    #Definir ajustes de virtualbox
    db.vm.provider "virtualbox" do |vb|
      vb.gui = false #No mostrar interfaz
      vb.name = 'BASES' #Nombre en virtualbox
      vb.memory = "512" #Memoria de la maquina
    end
  end
end