Quantcast
Channel: Active questions tagged vagrant - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 64

cannot ssh first vm created by multi vm vagrantfile and vm name net getting set & public network not getting created for second vm

$
0
0

I have written a multi-vm vagrant file, first I am not able to ssh using vagrant ssh dnsmasq to the first vm and for second vm the public network is not getting created i.e. after I ssh to pihole vm, it only had private network.

# -*- mode: ruby -*-# vi: set ft=ruby :VAGRANTFILE_API_VERSION = "2"PUBLIC_NET_BRIDGE = 'Realtek PCIe GbE Family Controller #5'PIHOLE_PUBLIC_IP =  "192.168.0.111"DNSMASQ_PUBLIC_IP = "192.168.0.121"Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|  config.vm.synced_folder ".", "/vagrant", mount_options: ["dmode=700,fmode=600"]  config.vm.box = "ubuntu/xenial64"  config.vm.provider "virtualbox" do |v|    v.memory = 1024    v.cpus = 1    v.customize ["modifyvm", :id, "--usb", "off"]    v.customize ["modifyvm", :id, "--usbehci", "off"]  end  config.vm.define "dnsmasq" do |d|    # d.provider.name = ""    d.vm.provider :virtualbox do |dvb|      dvb.customize ["modifyvm", :id, "--name", "dnsmasq"]    end    d.vm.hostname = "dnsmasq"    d.vm.network "public_network", ip: DNSMASQ_PUBLIC_IP, bridge: PUBLIC_NET_BRIDGE    d.vm.provision "shell", inline: <<-SHELL      apt-mark hold ubuntu-advantage-tools      apt-get update      apt-get upgrade -y      apt-get install dnsmasq -y    SHELL    d.vm.provision "shell", path: "provision.sh"    d.vm.provision "shell", inline: <<-SHELL      systemctl enable consul      systemctl restart dnsmasq      systemctl start consul    SHELL  end  config.vm.define "pihole" do |p|    # p.provider.name = "pihole"    # p.vm.hostname = "pihole"    p.vm.provider :pihole do |pvb|      pvb.customize ["modifyvm", :id, "--name", "pihole"]    end    p.vm.network "public_network", ip: PIHOLE_PUBLIC_IP, auto_config: false, bridge: PUBLIC_NET_BRIDGE    p.vm.provision "shell", inline: <<-SHELL      apt-mark hold ubuntu-advantage-tools      apt-get update      apt-get upgrade -y      apt-get install net-tools dnsutils -y    SHELL    endend

enter image description here


Viewing all articles
Browse latest Browse all 64

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>