VagrantFile Troubleshooting - New to Vagrant

All, I think this is a quick fix and I am just missing something stupid. Below is my code, what is weird is the MongoDB node AND Registry node, is running the Kubernetes-Setup.sh script and not the appropriate scripts. Any clue on what I am doing wrong?

-- mode: ruby --

vi: set ft=ruby :

Define variables for this environment

NUM_MASTER_NODE = 1
NUM_WORKER_NODE = 2

MASTER_NODE_NAME_PREFIX = “master0”
WORKER_NODE_NAME_PREFIX = “worker0”

IP_NW = “192.168.31.”
MASTER_IP_START = 9
NODE_IP_START = 19

Vagrant.configure(“2”) do |config|
#config.vm.box = “generic/ubuntu2204”
config.vm.box = “hashicorp/bionic64”

config.vm.synced_folder “Vagrant/”, “/vagrant”

Provision Master Nodes

(1…NUM_MASTER_NODE).each do |i|
master_node_name = MASTER_NODE_NAME_PREFIX + i.to_s

config.vm.define master_node_name do |node|
  # Configure non vendor specific provider settings
  node.vm.hostname = master_node_name

  # Verify this is only for VMware
  node.vm.provider "vmware_desktop" do |vb|
    vb.vmx["displayName"] = "MASTER0" + i.to_s
    vb.vmx["memsize"] = 16384
    vb.vmx["numvcpus"] = 4
  end
end

config.vm.provision :shell, :path => "vagrant/Kubernetes-Setup.sh"

end

Provision Worker Nodes

(1…NUM_WORKER_NODE).each do |i|
worker_node_name = WORKER_NODE_NAME_PREFIX + i.to_s

config.vm.define worker_node_name  do |node|
  # Configure non vendor specific provider settings
  node.vm.hostname = worker_node_name 

  # Verify this is only for VMware
  node.vm.provider "vmware_desktop" do |vb|
    vb.vmx["displayName"] = "WORKER0" + i.to_s
    vb.vmx["memsize"] = 32768
    vb.vmx["numvcpus"] = 4
  end
end

config.vm.provision :shell, :path => "vagrant/Kubernetes-Setup.sh"

end

Provision MongoDB 1-node

config.vm.hostname = “mongodb”
config.vm.define “mongodb” do |node|
# Configure non vendor specific provider settings
node.vm.provider “vmware_desktop” do |vb|
vb.vmx[“displayName”] = “MONGODB”
vb.vmx[“memsize”] = 16384
vb.vmx[“numvcpus”] = 4
end

config.vm.provision :shell, :path => "vagrant/MongoDB-Setup.sh"

end

Provision Private Registry

config.vm.hostname = “registry”
config.vm.define “registry” do |node|
# Configure non vendor specific provider settings
node.vm.provider “vmware_desktop” do |vb|
vb.vmx[“displayName”] = “REGISTRY”
vb.vmx[“memsize”] = 4096
vb.vmx[“numvcpus”] = 2
end

config.vm.provision :shell, :path => "vagrant/Registry-Setup.sh"

end

end

Fixed my issue after reviewing the multi-machine part of Vagrants documentation. Here is the code, if anyone in the future runs into this issue.

-- mode: ruby --

vi: set ft=ruby :

Define variables for this environment

NUM_MASTER_NODE = 1
NUM_WORKER_NODE = 2

MASTER_NODE_NAME_PREFIX = “master0”
WORKER_NODE_NAME_PREFIX = “worker0”

IP_NW = “192.168.31.”
MASTER_IP_START = 9
NODE_IP_START = 19

Vagrant.configure(“2”) do |config|
config.vm.box = “hashicorp/bionic64”
config.vm.synced_folder “Vagrant/”, “/vagrant”

Provision Master Nodes

(1…NUM_MASTER_NODE).each do |i|
master_node_name = MASTER_NODE_NAME_PREFIX + i.to_s

 config.vm.define master_node_name do |master|
    master.vm.hostname = master_node_name

    master.vm.provision "shell", path: "vagrant/Kubernetes-Setup.sh"

    master.vm.provider "vmware_desktop" do |vm_master_node|
      vm_master_node.vmx["displayName"] = "MASTER0" + i.to_s
      vm_master_node.vmx["memsize"] = 16384
      vm_master_node.vmx["numvcpus"] = 4
    end         
 end

end

Provision Worker Nodes

(1…NUM_WORKER_NODE).each do |i|
worker_node_name = WORKER_NODE_NAME_PREFIX + i.to_s

 config.vm.define worker_node_name do |worker|
    worker.vm.hostname = worker_node_name

    worker.vm.provision "shell", path: "vagrant/Kubernetes-Setup.sh"

    worker.vm.provider "vmware_desktop" do |vm_worker_node|
      vm_worker_node.vmx["displayName"] = "WORKER0" + i.to_s
      vm_worker_node.vmx["memsize"] = 32768
      vm_worker_node.vmx["numvcpus"] = 4
    end        
 end

end

config.vm.define “mongodb” do |mongodb|
mongodb.vm.synced_folder “Vagrant/”, “/vagrant”
mongodb.vm.provision “shell”, path: “vagrant/MongoDB-Setup.sh”

mongodb.vm.hostname = "mongodb"

mongodb.vm.provider "vmware_desktop" do |vm_mongo_node|
  vm_mongo_node.vmx["displayName"] = "MONGODB"
  vm_mongo_node.vmx["memsize"] = 16384
  vm_mongo_node.vmx["numvcpus"] = 4
end

end

config.vm.define “registry” do |registry|
registry.vm.synced_folder “Vagrant/”, “/vagrant”
registry.vm.provision “shell”, path: “vagrant/Registry-Setup.sh”

registry.vm.hostname = "mongodb"

registry.vm.provider "vmware_desktop" do |vm_registry_node|
  vm_registry_node.vmx["displayName"] = "REGISTRY"
  vm_registry_node.vmx["memsize"] = 4096
  vm_registry_node.vmx["numvcpus"] = 2
end

end

end