-
Notifications
You must be signed in to change notification settings - Fork 9
/
Vagrantfile
67 lines (55 loc) · 2.25 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -*- mode: ruby -*-
# vi: set ft=ruby :
# https://docs.vagrantup.com
Vagrant.configure("2") do |config|
config.vm.box = "debian/bookworm64"
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 = "8192"
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
apt-get purge --yes unattended-upgrades
apt-get autoremove --yes
apt-get autoclean --yes
apt-get clean --yes
# Python3 + PIP3
apt-get install python3-pip python3-venv python-is-python3 python3-ipython --yes --no-install-recommends
# Install pipx for managing system-wide cli tools
apt-get install pipx --yes --no-install-recommends
# Fix unmet dependency of system packages #12
#apt-get install 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 python cli tools for user vagrant
# ansible core and collections for provisioner playbook
pipx install "ansible-core~=2.17"
pipx inject ansible-core jmespath
/home/vagrant/.local/bin/ansible-galaxy collection install community.general
pipx install invoke
pipx install cookiecutter
pipx install networklab
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