-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathVagrantfile.2004
64 lines (50 loc) · 2.05 KB
/
Vagrantfile.2004
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- mode: ruby -*-
# vi: set ft=ruby :
# https://docs.vagrantup.com
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "127.0.0.1"
# private management network for devices to connect to (assign .1 to host machine)
config.vm.network 'private_network', ip: "10.250.0.11", netmask: 24, name: "vboxnet0"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
# disables console output logging to file
#vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
end
# User is "root".
config.vm.provision "shell", inline: <<-SHELL
# Update packages
apt-get update
apt-get dist-upgrade --yes
apt-get install --yes software-properties-common apt-transport-https
# Stop automatic updating for later boot-ups, this is not a prod box
# Snap is not needed, purge to reduce VM size
apt-get purge --yes unattended-upgrades snap
apt-get autoremove --yes
apt-get autoclean --yes
apt-get clean --yes
# Python3 + PIP3
apt-get install python3-pip python3-venv python-is-python3 --yes
# Fix unmet dependency of system packages #12
apt-get install python3-testresources python3-cairo --yes --no-install-recommends
SHELL
# User is "vagrant".
# These MUST be done in a separate shell as they change the pip path.
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Latest pip3 locally for user vagrant
python -m pip install -U --user pip
SHELL
# User is "vagrant".
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Install ansible locally for user vagrant
python -m pip install -U --user "ansible~=5.0" jmespath
SHELL
# Installs latest docker-ce
config.vm.provision "docker"
# User is "vagrant". Runs ansible inside of the VM on itself.
config.vm.provision "ansible_local" do |ansible|
ansible.install = false
ansible.playbook = "provision-ants.yml"
end
end