diff --git a/debian-generic/Vagrantfile b/debian-generic/Vagrantfile index 3457e89..17c8ac3 100644 --- a/debian-generic/Vagrantfile +++ b/debian-generic/Vagrantfile @@ -8,7 +8,7 @@ VAGRANTFILE_API_VERSION = '2' # Require 'yaml' module require 'yaml' -# Read YAML file with VM details (box, CPU, and RAM) +# Read YAML file with VM details (box, CPU, RAM, IP addresses) # Edit machines.yml to change VM configuration details machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml')) @@ -33,13 +33,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Specify the Vagrant box to use (use VMware box by default) srv.vm.box = machine['vmw_box'] - # Disable default synced folder - srv.vm.synced_folder '.', '/vagrant', disabled: true + # Configure default synced folder (disable by default) + if machine['sync_disabled'] != nil + srv.vm.synced_folder '.', '/vagrant', disabled: machine['sync_disabled'] + else + srv.vm.synced_folder '.', '/vagrant', disabled: true + end #if machine['sync_disabled'] + + # Assign additional private network + if machine['ip_addr'] != nil + srv.vm.network 'private_network', ip: machine['ip_addr'] + end # if machine['ip_addr'] # Configure CPU & RAM per settings in machines.yml (Fusion) srv.vm.provider 'vmware_fusion' do |vmw| vmw.vmx['memsize'] = machine['ram'] vmw.vmx['numvcpus'] = machine['vcpu'] + if machine['nested'] == true + vmw.vmx['vhv.enable'] = 'TRUE' + end #if machine['nested'] end # srv.vm.provider 'vmware_fusion' # Configure CPU & RAM per settings in machines.yml (VirtualBox) diff --git a/photon-ansible/Vagrantfile b/photon-ansible/Vagrantfile index 5672875..2d003af 100644 --- a/photon-ansible/Vagrantfile +++ b/photon-ansible/Vagrantfile @@ -8,7 +8,7 @@ VAGRANTFILE_API_VERSION = '2' # Require 'yaml' module require 'yaml' -# Read YAML file with VM details (box, CPU, and RAM) +# Read YAML file with VM details (box, CPU, RAM, IP addresses) # Edit machines.yml to change VM configuration details machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml')) @@ -33,8 +33,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Specify the Vagrant box to use (use VMware box by default) srv.vm.box = machine['vmw_box'] - # Disable default synced folder (not supported with Photon) - srv.vm.synced_folder '.', '/vagrant', disabled: true + # Configure default synced folder (disable by default) + if machine['sync_disabled'] != nil + srv.vm.synced_folder '.', '/vagrant', disabled: machine['sync_disabled'] + else + srv.vm.synced_folder '.', '/vagrant', disabled: true + end #if machine['sync_disabled'] # Assign additional private network if machine['ip_addr'] != nil @@ -42,10 +46,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end # if machine['ip_addr'] # Configure CPU & RAM per settings in machines.yml (Fusion) - # Nested virt not included because not supported with Photon srv.vm.provider 'vmware_fusion' do |vmw| vmw.vmx['memsize'] = machine['ram'] vmw.vmx['numvcpus'] = machine['vcpu'] + if machine['nested'] == true + vmw.vmx['vhv.enable'] = 'TRUE' + end #if machine['nested'] end # srv.vm.provider 'vmware_fusion' # Configure CPU & RAM per settings in machines.yml (VirtualBox) diff --git a/photon-cloudinit/Vagrantfile b/photon-cloudinit/Vagrantfile index bac3bd6..3a37f1f 100644 --- a/photon-cloudinit/Vagrantfile +++ b/photon-cloudinit/Vagrantfile @@ -8,7 +8,7 @@ VAGRANTFILE_API_VERSION = '2' # Require 'yaml' module require 'yaml' -# Read YAML file with VM details (box, CPU, and RAM) +# Read YAML file with VM details (box, CPU, RAM, IP addresses) # Edit machines.yml to change VM configuration details machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml')) @@ -37,14 +37,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Specify the Vagrant box to use (use VMware box by default) srv.vm.box = machine['vmw_box'] - # Disable default synced folder (not supported with Photon) - srv.vm.synced_folder '.', '/vagrant', disabled: true + # Configure default synced folder (disable by default) + if machine['sync_disabled'] != nil + srv.vm.synced_folder '.', '/vagrant', disabled: machine['sync_disabled'] + else + srv.vm.synced_folder '.', '/vagrant', disabled: true + end #if machine['sync_disabled'] + + # Assign additional private network + if machine['ip_addr'] != nil + srv.vm.network 'private_network', ip: machine['ip_addr'] + end # if machine['ip_addr'] # Configure CPU & RAM per settings in machines.yml (Fusion) - # Nested virt not included because not supported with Photon srv.vm.provider 'vmware_fusion' do |vmw| vmw.vmx['memsize'] = machine['ram'] vmw.vmx['numvcpus'] = machine['vcpu'] + if machine['nested'] == true + vmw.vmx['vhv.enable'] = 'TRUE' + end #if machine['nested'] end # srv.vm.provider 'vmware_fusion' # Configure CPU & RAM per settings in machines.yml (VirtualBox) diff --git a/photon/Vagrantfile b/photon/Vagrantfile index eab4448..17c8ac3 100644 --- a/photon/Vagrantfile +++ b/photon/Vagrantfile @@ -8,7 +8,7 @@ VAGRANTFILE_API_VERSION = '2' # Require 'yaml' module require 'yaml' -# Read YAML file with VM details (box, CPU, and RAM) +# Read YAML file with VM details (box, CPU, RAM, IP addresses) # Edit machines.yml to change VM configuration details machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml')) @@ -33,14 +33,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Specify the Vagrant box to use (use VMware box by default) srv.vm.box = machine['vmw_box'] - # Disable default synced folder (not supported with Photon) - srv.vm.synced_folder '.', '/vagrant', disabled: true + # Configure default synced folder (disable by default) + if machine['sync_disabled'] != nil + srv.vm.synced_folder '.', '/vagrant', disabled: machine['sync_disabled'] + else + srv.vm.synced_folder '.', '/vagrant', disabled: true + end #if machine['sync_disabled'] + + # Assign additional private network + if machine['ip_addr'] != nil + srv.vm.network 'private_network', ip: machine['ip_addr'] + end # if machine['ip_addr'] # Configure CPU & RAM per settings in machines.yml (Fusion) - # Nested virt not included because not supported with Photon srv.vm.provider 'vmware_fusion' do |vmw| vmw.vmx['memsize'] = machine['ram'] vmw.vmx['numvcpus'] = machine['vcpu'] + if machine['nested'] == true + vmw.vmx['vhv.enable'] = 'TRUE' + end #if machine['nested'] end # srv.vm.provider 'vmware_fusion' # Configure CPU & RAM per settings in machines.yml (VirtualBox) diff --git a/ubuntu-generic/Vagrantfile b/ubuntu-generic/Vagrantfile index 3457e89..17c8ac3 100644 --- a/ubuntu-generic/Vagrantfile +++ b/ubuntu-generic/Vagrantfile @@ -8,7 +8,7 @@ VAGRANTFILE_API_VERSION = '2' # Require 'yaml' module require 'yaml' -# Read YAML file with VM details (box, CPU, and RAM) +# Read YAML file with VM details (box, CPU, RAM, IP addresses) # Edit machines.yml to change VM configuration details machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml')) @@ -33,13 +33,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Specify the Vagrant box to use (use VMware box by default) srv.vm.box = machine['vmw_box'] - # Disable default synced folder - srv.vm.synced_folder '.', '/vagrant', disabled: true + # Configure default synced folder (disable by default) + if machine['sync_disabled'] != nil + srv.vm.synced_folder '.', '/vagrant', disabled: machine['sync_disabled'] + else + srv.vm.synced_folder '.', '/vagrant', disabled: true + end #if machine['sync_disabled'] + + # Assign additional private network + if machine['ip_addr'] != nil + srv.vm.network 'private_network', ip: machine['ip_addr'] + end # if machine['ip_addr'] # Configure CPU & RAM per settings in machines.yml (Fusion) srv.vm.provider 'vmware_fusion' do |vmw| vmw.vmx['memsize'] = machine['ram'] vmw.vmx['numvcpus'] = machine['vcpu'] + if machine['nested'] == true + vmw.vmx['vhv.enable'] = 'TRUE' + end #if machine['nested'] end # srv.vm.provider 'vmware_fusion' # Configure CPU & RAM per settings in machines.yml (VirtualBox)