Comments (2)
Yes, however config.vm.provider is a child of config.vm so it needs to be configured after your VM define statement.
config.vm.define "app1" do |app|
[...]
config.vm.provider :vsphere do |vsphere, override|
[...]
end
end
This model allows a single configuration to be provisioned by multiple providers, allowing portability.
Remember that the Vagrant file is a parsed ruby file, so anything that goes in ruby should apply to the Vagrant file
from vagrant-vsphere.
Thank you very much, @DarK501! Your comments helped me get where I needed to be. Below is a working configuration for others to use:
Vagrant.configure("2") do |config|
# General Vagrant VM configuration
config.vm.box = 'dummy'
config.vm.box_url = '/home/$user/vagrant/vsphere/dummy.box'
config.ssh.insert_key = false
#App 1 Definition - CentOS
config.vm.define "db01" do |app01|
app01.vm.hostname = "apptest01.host.net"
app01.vm.provider :vsphere do |vsphere, override|
override.nfs.functional = false
vsphere.host = 'vcsa01.host.net'
vsphere.user = '[email protected]'
vsphere.password = '$password'
vsphere.insecure = true
vsphere.compute_resource_name = 'Cluster01'
vsphere.template_name = 'vagrant/vagrant-tmpl/vagrant-centos7'
# vsphere.template_name = 'vagrant/vagrant-tmpl/vagrant-ubuntu1804'
vsphere.vm_base_path = 'vagrant/vagrant-vms'
vsphere.linked_clone = true
end
end
#App 2 Definition - Ubuntu
config.vm.define "app01" do |app02|
app02.vm.hostname = "apptest02.host.net"
app02.vm.provider :vsphere do |vsphere, override|
override.nfs.functional = false
vsphere.host = 'vcsa01.host.net'
vsphere.user = '[email protected]'
vsphere.password = '$password'
vsphere.insecure = true
vsphere.compute_resource_name = 'Cluster01'
# vsphere.template_name = 'vagrant/vagrant-tmpl/vagrant-centos7'
vsphere.template_name = 'vagrant/vagrant-tmpl/vagrant-ubuntu1804'
vsphere.vm_base_path = 'vagrant/vagrant-vms'
vsphere.linked_clone = true
end
end
#App 3 Definition - Ubuntu
config.vm.define "app02" do |app03|
app03.vm.hostname = "apptest02.host.net"
app03.vm.provider :vsphere do |vsphere, override|
override.nfs.functional = false
vsphere.host = 'vcsa01.host.net'
vsphere.user = '[email protected]'
vsphere.password = '$password'
vsphere.insecure = true
vsphere.compute_resource_name = 'Cluster01'
# vsphere.template_name = 'vagrant/vagrant-tmpl/vagrant-centos7'
vsphere.template_name = 'vagrant/vagrant-tmpl/vagrant-ubuntu1804'
vsphere.vm_base_path = 'vagrant/vagrant-vms'
vsphere.linked_clone = true
end
end
end
from vagrant-vsphere.
Related Issues (20)
- error-exit ["VagrantPlugins::VSphere::Errors::VSphereError", "execution expired"]
- undefined method `[]' for nil:NilClass after setting host name
- No setting for command timeout
- Is this project still maintained? HOT 1
- vagrant-vsphere install fails on vagrant 2.2.7
- Vagrant Configures with IPv6 instead of IPv4 HOT 1
- Specifying IPv4 address removes default gateway HOT 1
- Vagrantfile to manage existing VMs HOT 1
- Authentication to vCenter with 2FA TOTP
- Is there still active maintainers for this project ? HOT 1
- 400 Error when downloading vsphere-dummy box
- "can't modify frozen String" error on vagrant-vsphere 1.14.0 HOT 1
- vagant loop weird HOT 2
- Which vSphere Version?
- Cannot install in vagrant 2.3.4 from Debian HOT 2
- Prompt vsphere password programatically HOT 1
- Test issue for GH actions
- Test issue for GH actions - part two
- Test out GH actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vagrant-vsphere.