forked from CiscoDevNet/devnet-dev-vms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
46 lines (41 loc) · 1.99 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# This version uses the box in the Atlas catalogue
config.vm.box = "CiscoDevNet/devnet-dev-base-vbox"
# This version uses the local definition of the box
# config.vm.box = "devnet-dev-base-vbox"
config.vm.hostname = "devnetvm"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# Look out for this issue https://github.com/mitchellh/vagrant/issues/3083
config.vm.network "private_network", type: "dhcp"
# Configuring VBox
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
#
# Customize the amount of memory on the VM:
vb.memory = "2048"
# Enable the shared clipboard:
vb.customize ['modifyvm', :id, '--clipboard', 'bidirectional']
end
#
config.vm.provision "shell", path: "../devnet-dev-base-common/apt-get-update.sh"
# The cloud-init install is only required for VMs targetted to be used within VIRL
# config.vm.provision "shell", path: "../devnet-dev-base-common/cloud-init.sh"
config.vm.provision "shell", path: "../devnet-dev-base-common/cleanup-logs.sh"
config.vm.provision "shell", path: "../devnet-dev-base-common/zero-disk.sh"
config.vm.provision "shell", path: "../devnet-dev-base-common/passwd-age.sh"
config.vm.provision "shell", path: "../devnet-dev-base-common/hide_login_users.sh"
config.vm.provision "shell", path: "../devnet-dev-base-common/disable_vagrant_user.sh"
# This two step approach to copying files from the host seems sub-optimal
# but it is all that seems to work for now. See mv command below
config.vm.provision "file", source: "../devnet-dev-base-common/Desktop/README-base.txt", destination: "~vagrant/README.txt"
config.vm.provision "shell", inline: <<-SHELL
# Move provisioned files into place
sudo mv ~vagrant/README.txt ~cisco-devnet/Desktop/README
# Tidy up bash history
cat /dev/null > ~/.bash_history && history -c
SHELL
end