mhulse / vagrant-latmp

Vagrant LA(T)MP Stack: CentOS 7 + Apache HTTP + Apache Tomcat + MySQL + PHP + Python + Ruby + Node.js
Apache License 2.0
3 stars 3 forks source link

Multiple vms in one vagrant #6

Closed mhulse closed 6 years ago

mhulse commented 7 years ago
Vagrant.configure("2") do |config|
    config.vm.define "debbie" do |debbie|
        debbie.vm.box = "debian/jessie64"
        debbie.vm.network :forwarded_port, host: 80, guest: 80
        debbie.vm.network :forwarded_port, host: 3306, guest: 3306
        debbie.vm.network :forwarded_port, host: 2299, guest: 22
        debbie.vm.provision "shell", inline: "echo Hello"
    end

    config.vm.define "cindy" do |cindy|
        cindy.vm.box = "bento/centos-7.2"
        cindy.vm.network :forwarded_port, host: 8888, guest: 88
        cindy.vm.network :forwarded_port, host: 8080, guest: 80
        cindy.vm.network :forwarded_port, host: 3333, guest: 3306
        cindy.vm.network :forwarded_port, host: 2298, guest: 22
        cindy.vm.provision "shell", inline: "echo Hello"
    end
end
mhulse commented 7 years ago
$ vagrant up # both machines boot up. Then ...
$ vagrant ssh cindy
# … or:
$ vagrant ssh debbie
mhulse commented 7 years ago

Then if someone was using windows and wanted to use sftp netdrive to mount the drives so they could open via explorer

@echo off
Start "" "C:\Program Files (x86)\SFTP Net Drive 2017\Sftpnetdrive.exe" start /profile:"debbie"
Start "" "C:\Program Files (x86)\SFTP Net Drive 2017\Sftpnetdrive.exe" start /profile:"cindy"
Start "" "C:\Program Files (x86)\SFTP Net Drive 2017\Sftpnetdrive.exe" start /profile:"s1"

automates the connection process

mhulse commented 7 years ago

This is good info. Need to move it to WIKI and close this issue out.

mhulse commented 6 years ago

Added to wiki. Closing.