-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
39 lines (30 loc) · 1.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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Configure the box to use
config.vm.box = "ubuntu/jammy64"
# Configure X11 forwarding
config.ssh.forward_x11 = true
# Configure the resources for the virtual machine
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = 2
end
# Send the vault pass to the VM
config.vm.provision "file", source: "./vault-pass.txt", destination: "/home/vagrant/vault-pass.txt"
# Use a provisioning script to perform the actions you want
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Update and upgrade the system
sudo apt-get update && apt-get upgrade -y
# Install necessary packages
sudo apt-get install -y ansible git
# Clone the specified repository
git clone https://github.com/lucaspellegrinelli/dev-env-playbook.git /home/vagrant/dev-env-playbook
# Run Ansible playbook
ansible-playbook /home/vagrant/dev-env-playbook/playbook.yml --vault-password-file /home/vagrant/vault-pass.txt
rm -rf dev-env-playbook vault-pass.txt
mkdir -p projects
# Add the DISPLAY variable to the .zshrc file
echo 'export DISPLAY=10.0.2.2:0.0' >> /home/vagrant/.zshrc
SHELL
end