-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrades to terraform sdk v2; adds forwarded ports
- Loading branch information
Showing
16 changed files
with
573 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,31 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
required_plugins = %w(vagrant-ignition) | ||
plugins_to_install = required_plugins.reject(&Vagrant.method(:has_plugin?)) | ||
unless plugins_to_install.empty? | ||
puts "Installing plugins: #{plugins_to_install.join(', ')}" | ||
if system "vagrant plugin install #{plugins_to_install.join(' ')}" | ||
exec "vagrant #{ARGV.join(' ')}" | ||
else | ||
abort 'Installation of one or more plugins failed.' | ||
end | ||
end | ||
|
||
$vm_cpus = 1 | ||
$vm_memory = 1024 | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "minimal/trusty64" | ||
|
||
config.ssh.insert_key = false | ||
config.ssh.forward_agent = true | ||
|
||
config.vm.box = 'coreos-stable' | ||
config.vm.box_url = 'https://stable.release.core-os.net/amd64-usr/current/coreos_production_vagrant_virtualbox.json' | ||
config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true | ||
|
||
config.vm.synced_folder ".", "/vagrant", disabled: true | ||
|
||
if Vagrant.has_plugin? 'vagrant-vbguest' | ||
config.vbguest.auto_update = false | ||
end | ||
|
||
config.vm.provider :virtualbox do |vb| | ||
vb.customize ["modifyvm", :id, "--usb", "on"] | ||
vb.customize ["modifyvm", :id, "--usbehci", "off"] | ||
|
||
vb.gui = false | ||
vb.cpus = $vm_cpus | ||
vb.memory = $vm_memory | ||
vb.check_guest_additions = false | ||
vb.functional_vboxsf = false | ||
config.ignition.enabled = true | ||
config.ignition.config_obj = vb | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
vagrant = { | ||
source = "bmatcuk/vagrant" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "host_port" { | ||
value = vagrant_vm.my_vagrant_vm.ports[0][0].host | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
resource "vagrant_vm" "my_vagrant_vm" { | ||
env = { | ||
# force terraform to re-run vagrant if the Vagrantfile changes | ||
VAGRANTFILE_HASH = "${md5(file("path/to/Vagrantfile"))}", | ||
VAGRANTFILE_HASH = md5(file("./Vagrantfile")), | ||
} | ||
get_ports = true | ||
# see schema for additional options | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.