Skip to content

Commit

Permalink
Make /data disk work on any vagrant provider
Browse files Browse the repository at this point in the history
  • Loading branch information
benwaffle committed Mar 14, 2024
1 parent 5a1b6ee commit 746fa8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
id_rsa
id_rsa
.vagrant/
22 changes: 11 additions & 11 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
Vagrant.configure("2") do |config|
# Provision /data. In production, the size is hard-coded in web.
# https://github.com/superfly/web/blob/663d025e29d52567ffb6cbe1b2d8640ac7099e46/app/graphql/mutations/ensure_machine_remote_builder.rb#L87
config.vm.provider :libvirt do |libvirt|
libvirt.storage :file, :size => '50GB'
config.vm.provision 'mount_data', type:"shell", inline: <<-SHELL
set -euo pipefail
config.vm.disk :disk, name: "data", size: '50GB'
config.vm.provision 'mount_data', type:"shell", inline: <<-SHELL
set -euo pipefail
parted /dev/vdb --script mklabel gpt
parted /dev/vdb --script mkpart primary ext4 0% 100%
lsblk
mkfs.ext4 /dev/vdb1
parted /dev/sdb --script mklabel gpt
parted /dev/sdb --script mkpart primary ext4 0% 100%
mkdir /data
mount /dev/vdb1 /data
SHELL
end
mkfs.ext4 /dev/sdb1
mkdir /data
mount /dev/sdb1 /data
SHELL

# Host-only network configuration
config.vm.network "private_network", ip: "192.168.50.10"
Expand Down

0 comments on commit 746fa8c

Please sign in to comment.