Created
October 18, 2018 19:52
-
-
Save briancain/cee68d3aaef43ed8cf42f2a3544e3fb7 to your computer and use it in GitHub Desktop.
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
brian@localghost:vagrant-sandbox % HELLO="hello" be vagrant up bork ±[●][master] | |
Bringing machine 'bork' up with 'virtualbox' provider... | |
==> bork: Running triggers before up ... | |
==> bork: Running trigger... | |
hi | |
hello | |
==> bork: Cloning VM... | |
==> bork: Matching MAC address for NAT networking... | |
==> bork: Checking if box 'bento/ubuntu-18.04' is up to date... | |
==> bork: Setting the name of the VM: vagrant-sandbox_bork_1539892258393_75645 | |
==> bork: Fixed port collision for 22 => 2222. Now on port 2200. | |
==> bork: Clearing any previously set network interfaces... | |
==> bork: Preparing network interfaces based on configuration... | |
bork: Adapter 1: nat | |
==> bork: Forwarding ports... | |
bork: 22 (guest) => 2200 (host) (adapter 1) | |
==> bork: Booting VM... | |
==> bork: Waiting for machine to boot. This may take a few minutes... | |
bork: SSH address: 127.0.0.1:2200 | |
bork: SSH username: vagrant | |
bork: SSH auth method: private key | |
bork: | |
bork: Vagrant insecure key detected. Vagrant will automatically replace | |
bork: this with a newly generated keypair for better security. | |
bork: | |
bork: Inserting generated public key within guest... | |
bork: Removing insecure key from the guest if it's present... | |
bork: Key inserted! Disconnecting and reconnecting using new SSH key... | |
==> bork: Machine booted and ready! | |
==> bork: Checking for guest additions in VM... | |
==> bork: Setting hostname... | |
==> bork: Mounting shared folders... | |
bork: /vagrant => /home/brian/code/vagrant-sandbox | |
==> bork: Running provisioner: shell... | |
bork: Running: inline script | |
bork: hello |
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
Vagrant.configure("2") do |config| | |
config.vm.define "bork" do |b| | |
b.vm.box = "bento/ubuntu-18.04" | |
b.vm.hostname = "test.test" | |
b.trigger.before :up do |t| | |
hostname = ENV["HELLO"] | |
t.ruby do |env,machine| | |
puts "hi" | |
puts hostname | |
end | |
b.vm.hostname = hostname | |
end | |
b.vm.provision "shell", inline:<<-SHELL | |
hostname -f | |
SHELL | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment