-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathVagrantfile.1804
66 lines (47 loc) · 1.95 KB
/
Vagrantfile.1804
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# https://docs.vagrantup.com
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
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 = "1024"
# disables console output logging to file
vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
end
# User is "root".
config.vm.provision "shell", inline: <<-SHELL
# Ensure latest Ansible via APT
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
apt-get purge --yes unattended-upgrades
# Python3 + PIP3
apt-get install python3-pip python3-venv --no-install-recommends --yes
# Python2 + PIP2
apt-get install python-minimal python-pip python-virtualenv python-setuptools --no-install-recommends --yes
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
# Python3 + PIP3 + ansible
pip3 install -U --user pip setuptools wheel
# Python2 + PIP2
pip2 install -U --user pip setuptools wheel
SHELL
# User is "vagrant".
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Python3 + ansible
pip3 install -U --user "ansible>=2.9,<2.10" 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