-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
50 lines (36 loc) · 1.35 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This configuration requires Vagrant 1.5 or newer
# Plugins:
# vagrant plugin install vagrant-hosts ~> 2.1.4
# vagrant plugin install vagrant-auto_network ~> 1.0.0
# vagrant plugin install vagrant-triggers
Vagrant.require_version ">= 1.5.0"
require 'vagrant-hosts'
require 'vagrant-auto_network'
require 'vagrant-triggers'
Vagrant.configure('2') do |config|
config.vm.define :beautiful_emacs do |node|
node.vm.box = 'ubuntu/xenial64'
node.vm.hostname = 'beautifulemacs.vlan'
# Use vagrant-auto_network to assign an IP address.
node.vm.network :private_network, :auto_network => true
# Use vagrant-hosts to add entries to /etc/hosts for each virtual machine
# in this file.
node.vm.provision :hosts
node.vm.provision :shell, :path => 'provision_vm.sh', privileged: false
node.vm.provider "virtualbox" do |v|
v.memory = 768
v.cpus = 1
end
end
copy_key_command = "cp %s/.ssh/id_rsa ./id_rsa" % [ENV['HOME']]
have_ssh_key = File.file?("%s/.ssh/id_rsa" % [ENV["HOME"]])
copy_ssh_key = !File.file?("%s/id_rsa" % [File.dirname(__FILE__)])
config.trigger.before :up do
if have_ssh_key and copy_ssh_key
info "Copying ~/.ssh/id_rsa into this directory so github can load it for cloning emacs config"
run copy_key_command
end
end
end