Add something that kinda works, but not really

Need to finish getting disk resizing to work
This commit is contained in:
IamTheFij 2017-05-17 10:16:10 -07:00
parent ce6bf71896
commit 916600c77b
3 changed files with 87 additions and 0 deletions

Vagrantfile vendored Normal file
View File

@ -0,0 +1,81 @@
# -*- mode: ruby -*-
# vi: set ft=ruby sw=2 ts=2 :
# Set this to custom url if using a fork
cloudron_setup_url = ''
Vagrant.configure(2) do |config|
# Minimum requirement for Cloudron is 16.04 = "ubuntu/xenial64"
# Mosh is super nice, why not?
enable_mosh = false
if enable_mosh
(60000..61000).each do |p| "forwarded_port", guest: p, host: p, protocol: 'udp'
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# "forwarded_port", guest: 80, host: 8080
# "forwarded_port", guest: 443, host: 8081 "private_network", ip: ""
# Set hostname for the box
config.vm.hostname = ""
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "~/.ssh", "~/.ssh/vagrant_data"
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
# Customize the amount of memory on the VM:
vb.memory = "2048"
# disk_filepath "~/VirtualBox\ VMs/#{:name}/disk1.vdi"
disk_filepath = 'disk1.vdi'
if ARGV[0] == "up" && ! File.exists?(disk_filepath)
# Create vdi
config.vm.provider :virtualbox do |vb|
vb.customize [
'--filename', disk_filepath,
'--format', 'VDI',
# 20GB
'--size', 20 * 1024
vb.customize [
'storageattach', :id,
'--storagectl', 'IDE',
'--port', 1, '--device', 0,
'--type', 'hdd', '--medium',
# Run script to map new disk
config.vm.provision "shell", inline: <<-SHELL
pvcreate /dev/sdb
vgextend VolGroup /dev/sdb
lvextend /dev/VolGroup/lv_root /dev/sdb
resize2fs /dev/VolGroup/lv_root
# Set up Cloudron on provision. If using a fork, change this URL
config.vm.provision "shell", inline: <<-SHELL
wget #{cloudron_setup_url}
chmod +x cloudron-setup
./cloudron-setup --domain --provider generic --tls-provider fallback --dns-provider noop

3 Executable file
View File

@ -0,0 +1,3 @@
#! /bin/bash
vagrant ssh -c 'journalctl -u box -af'

3 Executable file
View File

@ -0,0 +1,3 @@
#! /bin/bash
vagrant ssh -c 'systemctl restart box'